Przeglądaj źródła

账户流水bug

cz 1 rok temu
rodzic
commit
5ef37ab4a1

+ 53 - 11
src/views/finance/fundManage/accountStatement/index.vue

@@ -178,6 +178,7 @@
                     v-model="formData.data.currency"
                     placeholder="请选择"
                     style="width: 100%"
+                    @change="changeAmount"
                   >
                     <el-option
                       v-for="item in accountCurrency"
@@ -198,12 +199,41 @@
                     :precision="2"
                     :controls="false"
                     :min="0"
+                    @change="changeAmount"
                   />
                 </el-form-item>
               </el-col>
             </el-row>
           </div>
         </template>
+        <template #amountCny>
+          <div style="width: 100%">
+            <el-row :gutter="10">
+              <el-col :span="12">
+                <el-form-item prop="amountCny">
+                  <el-input-number
+                    onmousewheel="return false;"
+                    v-model="formData.data.amountCny"
+                    placeholder="请输入汇算人民币金额"
+                    style="width: 100%"
+                    :precision="2"
+                    :controls="false"
+                    :min="0"
+                  />
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
+                <span v-if="formData.data.amount && formData.data.amountCny"
+                  >汇率是:{{
+                    parseFloat(
+                      formData.data.amountCny / formData.data.amount
+                    ).toFixed(2)
+                  }}</span
+                >
+              </el-col>
+            </el-row>
+          </div>
+        </template>
         <template #received>
           <div>
             <el-form-item prop="received">
@@ -511,17 +541,17 @@ const config = computed(() => {
       },
       renderHTML(row) {
         return [
-          {
-            attrs: {
-              label: "修改",
-              type: "primary",
-              text: true,
-            },
-            el: "button",
-            click() {
-              update(row);
-            },
-          },
+          // {
+          //   attrs: {
+          //     label: "修改",
+          //     type: "primary",
+          //     text: true,
+          //   },
+          //   el: "button",
+          //   click() {
+          //     update(row);
+          //   },
+          // },
           {
             attrs: {
               label: "删除",
@@ -672,6 +702,12 @@ const formConfig = computed(() => {
       slotName: "money",
       label: "交易金额",
     },
+    {
+      type: "slot",
+      prop: "amountCny",
+      slotName: "amountCny",
+      label: "汇算人民币金额",
+    },
     formData.data.status == "10"
       ? {
           type: "slot",
@@ -1131,6 +1167,12 @@ const submitFormTwo = () => {
     );
   });
 };
+
+const changeAmount = () => {
+  if (formData.data.currency == "CNY") {
+    formData.data.amountCny = formData.data.amount;
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 14 - 6
src/views/finance/fundManage/flow/index.vue

@@ -167,6 +167,7 @@
                     v-model="formData.data.currency"
                     placeholder="请选择"
                     style="width: 100%"
+                    @change="changeAmount"
                   >
                     <el-option
                       v-for="item in accountCurrency"
@@ -187,6 +188,7 @@
                     :precision="2"
                     :controls="false"
                     :min="0"
+                    @change="changeAmount"
                   />
                 </el-form-item>
               </el-col>
@@ -201,7 +203,7 @@
                   <el-input-number
                     onmousewheel="return false;"
                     v-model="formData.data.amountCny"
-                    placeholder="请输入人民币金额"
+                    placeholder="请输入汇算人民币金额"
                     style="width: 100%"
                     :precision="2"
                     :controls="false"
@@ -434,7 +436,7 @@
                   <el-input-number
                     onmousewheel="return false;"
                     v-model="formData.settleData.amountCny"
-                    placeholder="请输入人民币金额"
+                    placeholder="请输入汇算人民币金额"
                     style="width: 100%"
                     :precision="2"
                     :controls="false"
@@ -815,7 +817,7 @@ const formConfig = computed(() => {
       type: "slot",
       prop: "amountCny",
       slotName: "amountCny",
-      label: "人民币金额",
+      label: "汇算人民币金额",
     },
     formData.data.status == "10"
       ? {
@@ -1202,7 +1204,7 @@ const settleForm = ref(null);
 const settleDialog = ref(false);
 const settleRules = ref({
   amountCny: [
-    { required: true, message: "请输入人民币金额", trigger: "blur" },
+    { required: true, message: "请输入汇算人民币金额", trigger: "blur" },
   ],
 });
 const settleFormOption = reactive({
@@ -1243,7 +1245,7 @@ const settleFormConfig = computed(() => {
       type: "slot",
       prop: "amountCny",
       slotName: "amountCny",
-      label: "人民币金额",
+      label: "汇算人民币金额",
     },
   ];
 });
@@ -1261,7 +1263,7 @@ const submitSettleForm = () => {
       !formData.settleData.amountCny ||
       Number(formData.settleData.amountCny) == 0
     ) {
-      return ElMessage("人民币金额不能为0");
+      return ElMessage("汇算人民币金额不能为0");
     }
     loadingDialog.value = true;
     proxy
@@ -1285,6 +1287,12 @@ const submitSettleForm = () => {
       );
   });
 };
+
+const changeAmount = () => {
+  if (formData.data.currency == "CNY") {
+    formData.data.amountCny = formData.data.amount;
+  }
+};
 </script>
 
 <style lang="scss" scoped>

+ 1 - 1
src/views/salesMange/saleContract/claim/index.vue

@@ -495,7 +495,7 @@ const formConfig = reactive([
   {
     type: "number",
     prop: "amountCny",
-    label: "转人民金额",
+    label: "汇算人民币金额",
     itemWidth: 30,
     disabled: true,
     precision: 2,