Explorar el Código

feat: 流程审批动作

liuc hace 7 meses
padre
commit
78c2f3a459

+ 1 - 0
.env.development

@@ -5,3 +5,4 @@ VITE_APP_FILE_URL='http://192.168.21.77:2024/upload'
 VITE_APP_API_BASE_URL='http://localhost:8081/#'
 VITE_APP_API_FILE_VIEW_URL='http://192.168.17.153:8812'
 VITE_APP_API_CUSTOM_URL='/base-api'
+VITE_APP_API_WEBSOCKET='ws://27.223.11.42:9100/scene'

+ 1 - 0
.env.production

@@ -5,3 +5,4 @@ VITE_APP_FILE_URL='http://192.168.21.77:2024/upload'
 VITE_APP_API_BASE_URL='http://27.223.11.42:9102/#'
 VITE_APP_API_FILE_VIEW_URL='http://27.223.11.42:8812'
 VITE_APP_API_CUSTOM_URL='/common-api'
+VITE_APP_API_WEBSOCKET='ws://27.223.11.42:9100/scene'

+ 6 - 1
src/views/flow/stFormWork/components/headerOperate/pcOperate.vue

@@ -5,7 +5,7 @@
         <div class="sheet-row">
           <div v-show="loadBeforeOver">
             <a-button class="btn-com"
-                      v-for="(n,i) in actions"
+                      v-for="(n,i) in actionsSorted"
                       v-show="n.visible"
                       type="primary"
                       @click="n.callback"
@@ -38,6 +38,11 @@ export default {
   data() {
     return {};
   },
+  computed: {
+    actionsSorted() {
+      return this.actions.slice().sort((a, b) => a.index - b.index);
+    }
+  },
   methods: {
 
 

+ 13 - 0
src/views/flow/stFormWork/componentsConfig/index.js

@@ -8,6 +8,7 @@ export function getActionList() {
             mobileVisible: false,
             visible: true,
             mobileIndex: -1,
+            index:10,
             callback: () => {
                 this.handleClose();
             },
@@ -17,6 +18,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: false,
             mobileIndex: -1,
+            index:20,
             visible: (this.instanceObj.value.exceptional == 1 || (this.tag.value != 'START' && this.tag.value != 'EDIT' && this.viewFlowBtn.value.show)),
             callback: () => {
                 this.handleViewFlow();
@@ -27,6 +29,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: false,
             mobileIndex: -1,
+            index:30,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && this.tag.value != 'START' && this.tag.value != 'EDIT',
             callback: () => {
@@ -38,6 +41,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: -1,
+            index:40,
             visible: (this.instanceObj.value.exceptional != 1 && (this.tag.value == 'START' || this.tag.value == 'WRITE' || this.tag.value == 'AUDIT') && this.saveBtn.value.show && this.preview.value == false) || this.tag.value == 'EDIT',
             callback: () => {
                 this.handleSave();
@@ -48,6 +52,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: 1,
+            index:50,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && (this.tag.value == 'START' || this.tag.value == 'WRITE' || this.tag.value == 'AUDIT') && this.submitBtn.value.show && this.preview.value == false,
             callback: () => {
@@ -59,6 +64,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: 2,
+            index:60,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && this.tag.value == 'AUDIT' && this.rejectBtn.value.show,
             callback: () => {
@@ -70,6 +76,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: -1,
+            index:70,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' &&
                 (this.taskObj.value.itemType == '1' || this.taskObj.value.itemType == '2') && this.retrieve.value == '1',
@@ -83,6 +90,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: 1,
+            index:80,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && this.tag.value == 'CIRCULATE',
             callback: () => {
@@ -94,6 +102,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: -1,
+            index:90,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && this.tag.value == 'AUDIT' && this.operatePower.value.forward,
             callback: () => {
@@ -105,6 +114,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: -1,
+            index:100,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && this.tag.value == 'AUDIT' && this.operatePower.value.add,
             callback: () => {
@@ -116,6 +126,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: -1,
+            index:110,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && this.tag.value != 'START' && this.tag.value != 'WRITE' && this.operatePower.value.circulation,
             callback: () => {
@@ -127,6 +138,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: -1,
+            index:120,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && this.tag.value == 'WRITE' && this.cancelBtn.value.show && this.preview.value == false,
             callback: () => {
@@ -139,6 +151,7 @@ export function getActionList() {
             disabled: false,
             mobileVisible: true,
             mobileIndex: -1,
+            index:990,
             visible: this.instanceObj.value.exceptional != 1 &&
                 this.tag.value != 'EDIT' && this[v].value.show,
             callback: () => {

+ 86 - 80
src/views/flow/stFormWork/formWork.vue

@@ -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容器的表现也显示隐藏