feature/pay-0704-ch
ch 3 years ago
parent ae3ed669a3
commit 84db73c9b3

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-07-04 16:42:21
* @LastEditors: ch
* @LastEditTime: 2022-07-07 15:51:16
* @LastEditTime: 2022-07-07 16:26:45
* @Description: file content
-->
<template>
@ -131,23 +131,26 @@
return meRules;
});
const formEl = ref();
const formEl = ref(null);
const init = () => {
store.dispatch('application/getMerchantList');
store.dispatch('application/getPayType');
onActivated(() => {
handlelLoadData();
});
/**
* 如果是编辑需要加载初始数据加载
*/
const handlelLoadData = async () => {
form.mchInfo = {};
formEl.value.resetFields();
let id = route.params.id;
if (id && form.id !== id) {
handlelLoadDetail(id);
}
};
onActivated(init);
/**
* 编辑加载初始数据加载
*/
const handlelLoadDetail = async (id) => {
let res = await store.dispatch('application/detail', id);
res.payCodes = res.payCodes.split(',');
Object.assign(form, res);
}
};
/**
* 切换商户时需要拿到当前商户信息用来应用判断属于哪个平台
@ -191,8 +194,6 @@
} catch (e) {}
};
const handleCancel = () => {
Object.assign(form, defaultForm);
formEl.value.resetFields();
router.push({ name: 'PayApplication' });
};
</script>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-15 17:29:32
* @LastEditors: ch
* @LastEditTime: 2022-07-06 16:46:56
* @LastEditTime: 2022-07-07 16:32:44
* @Description: file content
-->
<template>
@ -92,10 +92,13 @@
await store.dispatch('application/search', { ...state.condition });
loading.value = false;
};
const init = () => {
store.dispatch('application/getMerchantList');
store.dispatch('application/getPayType');
onActivated(handleSearch);
handleSearch();
};
onActivated(init);
/**
* 重置
*/

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-07-04 16:42:21
* @LastEditors: ch
* @LastEditTime: 2022-07-07 15:50:18
* @LastEditTime: 2022-07-07 16:30:11
* @Description: file content
-->
<template>
@ -62,16 +62,21 @@
const aliFormEl = ref();
const wxFormEl = ref();
const init = () => {
store.dispatch('merchant/getMerchantPlatform');
onActivated(() => {
handlelLoadData();
});
formEl.value.resetFields();
wxFormEl.value && wxFormEl.value.resetFields();
aliFormEl.value && aliFormEl.value.resetFields();
let id = route.params.id;
if (id && form.id !== id) {
handlelLoadDetail();
}
};
onActivated(init);
/**
* 如果是编辑需要加载初始数据加载
*/
const handlelLoadData = async () => {
let id = route.params.id;
if (id && form.id !== id) {
const handlelLoadDetail = async () => {
let res = await store.dispatch('merchant/detail', id);
if (res.mchCode === 'alipay') {
const publicKey = res.aliMchData.publicKey;
@ -89,7 +94,6 @@
delete res.wxMchData.serialNo;
}
Object.assign(form, res);
}
};
const handleSave = async () => {
let validate = false;
@ -108,10 +112,6 @@
.catch(() => {});
};
const handleCancel = () => {
Object.assign(form, defaultForm);
wxFormEl.value && wxFormEl.value.resetFields();
aliFormEl.value && aliFormEl.value.resetFields();
formEl.value.resetFields();
router.push({ name: 'PayMerchant' });
};
</script>

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-15 17:29:32
* @LastEditors: ch
* @LastEditTime: 2022-07-06 14:34:01
* @LastEditTime: 2022-07-07 16:31:04
* @Description: file content
-->
<template>
@ -72,6 +72,11 @@
const state = reactive({
condition: { ..._condition },
});
const init = () => {
store.dispatch('merchant/getMerchantPlatform');
handleSearch();
};
onActivated(init);
/**
* 搜索
@ -82,8 +87,6 @@
loading.value = false;
};
store.dispatch('merchant/getMerchantPlatform');
onActivated(handleSearch);
/**
* 重置
*/

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-15 17:29:32
* @LastEditors: ch
* @LastEditTime: 2022-07-07 14:38:28
* @LastEditTime: 2022-07-07 16:34:27
* @Description: file content
-->
<template>
@ -109,6 +109,14 @@
condition: { ..._condition },
});
store.dispatch('payOrder/getPayType');
const init = () => {
store.dispatch('payOrder/getMerchantList');
store.dispatch('payOrder/getApplicationList');
handleSearch();
};
onActivated(init);
/**
* 搜索
*/
@ -123,11 +131,6 @@
await store.dispatch('payOrder/search', par);
loading.value = false;
};
store.dispatch('payOrder/getMerchantList');
store.dispatch('payOrder/getApplicationList');
store.dispatch('payOrder/getPayType');
onActivated(handleSearch);
/**
* 重置
*/

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-06-15 17:29:32
* @LastEditors: ch
* @LastEditTime: 2022-07-07 15:30:13
* @LastEditTime: 2022-07-07 16:33:53
* @Description: file content
-->
<template>
@ -102,6 +102,14 @@
condition: { ..._condition },
});
store.dispatch('refundOrder/getPayType');
const init = () => {
store.dispatch('refundOrder/getMerchantList');
store.dispatch('refundOrder/getApplicationList');
handleSearch();
};
onActivated(init);
/**
* 搜索
*/
@ -117,10 +125,6 @@
loading.value = false;
};
store.dispatch('refundOrder/getMerchantList');
store.dispatch('refundOrder/getApplicationList');
store.dispatch('refundOrder/getPayType');
onActivated(handleSearch);
/**
* 重置
*/

Loading…
Cancel
Save