lianzhichao 1 tydzień temu
rodzic
commit
a1a92799d8
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      src/views/customer/list/index.vue

+ 3 - 3
src/views/customer/list/index.vue

@@ -212,15 +212,15 @@
                 confirmButtonText: '确定',
                 cancelButtonText: '取消',
                 inputPlaceholder: '请输入扣减金额',
-                inputPattern: /^([1-9]\d*)(\.\d{1,2})?$/,
-                inputErrorMessage: '请输入大于0的金额,最多两位小数',
+                inputPattern: /^(?!0+(\.0+)?$)([1-9]\d*|0)(\.\d{1,2})?$/,
+                inputErrorMessage: '金额必须大于0,且最多两位小数(例如:1.23 或 0.5)',
                 draggable: true
             }
         ).then(({ value }) => {
             request
                 .post('/user/userAccountInfo/reduceUserAccount', {
                     userId: row.id,
-                    reduceMoney: Number(value)
+                    reduceMoney: Number(value).toFixed(2)
                 })
                 .then((res) => {
                     if (res.data.code == 200) {