Ver Fonte

feat(): 新增账号和订单时带入商户id

zerogo há 5 meses atrás
pai
commit
c38bee7af4
2 ficheiros alterados com 26 adições e 1 exclusões
  1. 24 1
      src/modules/virtual/views/bank.vue
  2. 2 0
      src/modules/virtual/views/order.vue

+ 24 - 1
src/modules/virtual/views/bank.vue

@@ -32,6 +32,22 @@
 <script lang="ts" name="virtual-bank" setup>
 import { useCrud, useTable, useUpsert } from '@cool-vue/crud';
 import { useCool } from '/@/cool';
+import { storage } from '/@/cool';
+const emit = defineEmits(['close', 'submit']);
+const props = defineProps({
+	open: {
+		type: Boolean,
+		default: false
+	},
+	mchId: {
+		type: String,
+		default: ''
+	},
+	business: {
+		type: Object,
+		default: null
+	}
+});
 
 const { service } = useCool();
 
@@ -107,7 +123,14 @@ const Upsert = useUpsert({
 			component: { name: 'cl-switch' },
 			required: true
 		}
-	]
+	],
+	async onSubmit(data, { done, close, next }) {
+		emit('submit');
+		next({
+			...data,
+			merchantId: storage.get('userInfo').merchant.id
+		});
+	}
 });
 
 // cl-table

+ 2 - 0
src/modules/virtual/views/order.vue

@@ -32,6 +32,7 @@
 <script lang="ts" name="virtual-order" setup>
 import { useCrud, useTable, useUpsert } from '@cool-vue/crud';
 import { useCool } from '/@/cool';
+import { storage } from '/@/cool';
 import dayjs from 'dayjs';
 const { service } = useCool();
 
@@ -155,6 +156,7 @@ const Upsert = useUpsert({
 		data.swiftCode = bank.swiftCode;
 		data.paymentAccount = bank.accountNumber;
 		data.bankType = bank.bankName;
+		data.merchantId = storage.get('userInfo').merchant.id
 		next(data);
 	}
 });