|
|
|
|
@ -10,6 +10,7 @@ import {
|
|
|
|
|
ProfitsharingDeleteAction,
|
|
|
|
|
ProfitsharingListAction,
|
|
|
|
|
HospitalProfitsharingStatusAction,
|
|
|
|
|
ProfitsharingTestAction,
|
|
|
|
|
$response
|
|
|
|
|
} from '~/api'
|
|
|
|
|
import {h} from "vue";
|
|
|
|
|
@ -22,10 +23,14 @@ const $props = defineProps({
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
const profitsharing_status = ref(false)
|
|
|
|
|
const profitsharing_type = ref(0)
|
|
|
|
|
const HospitalProfitsharingStatus = async () => {
|
|
|
|
|
const response = await HospitalProfitsharingStatusAction()
|
|
|
|
|
const response = await HospitalProfitsharingStatusAction({
|
|
|
|
|
hospital: $props.hospital
|
|
|
|
|
})
|
|
|
|
|
$response(response, () => {
|
|
|
|
|
profitsharing_status.value = response.data.info.open === 1
|
|
|
|
|
profitsharing_status.value = response.data.info.open === 1 || response.data.info.open === 3
|
|
|
|
|
profitsharing_type.value = response.data.info.open
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const profitsharing_list = ref([])
|
|
|
|
|
@ -65,9 +70,6 @@ const profitsharing_columns = [{
|
|
|
|
|
}, {
|
|
|
|
|
title: '计算公式',
|
|
|
|
|
key: 'formula'
|
|
|
|
|
}, {
|
|
|
|
|
title: '最大分账',
|
|
|
|
|
key: 'max'
|
|
|
|
|
}, {
|
|
|
|
|
title: '描述',
|
|
|
|
|
key: 'desc'
|
|
|
|
|
@ -95,11 +97,28 @@ const create_data_default = {
|
|
|
|
|
name: '',
|
|
|
|
|
account: '',
|
|
|
|
|
formula: '',
|
|
|
|
|
max: 0,
|
|
|
|
|
desc: '',
|
|
|
|
|
status: 1,
|
|
|
|
|
}
|
|
|
|
|
const create_data = ref(JSON.parse(JSON.stringify(create_data_default)))
|
|
|
|
|
const test_data = ref({
|
|
|
|
|
in_value: 0,
|
|
|
|
|
out_value: 0
|
|
|
|
|
})
|
|
|
|
|
const ProfitsharingTest = async () => {
|
|
|
|
|
let data = {
|
|
|
|
|
in_value: test_data.value.in_value
|
|
|
|
|
}
|
|
|
|
|
if (create_show.value) {
|
|
|
|
|
data.php = create_data.value.formula
|
|
|
|
|
} else {
|
|
|
|
|
data.php = update_data.value.formula
|
|
|
|
|
}
|
|
|
|
|
const response = await ProfitsharingTestAction(data)
|
|
|
|
|
$response(response, () => {
|
|
|
|
|
test_data.value.out_value = response.data.out_value
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
const ProfitsharingCreate = async () => {
|
|
|
|
|
let data = {
|
|
|
|
|
...create_data.value,
|
|
|
|
|
@ -124,7 +143,6 @@ const update_data_default = {
|
|
|
|
|
name: '',
|
|
|
|
|
account: '',
|
|
|
|
|
formula: '',
|
|
|
|
|
max: 0,
|
|
|
|
|
desc: '',
|
|
|
|
|
status: 1,
|
|
|
|
|
}
|
|
|
|
|
@ -214,13 +232,19 @@ onMounted(() => {
|
|
|
|
|
<n-tag>
|
|
|
|
|
<div class="form_tag_wrapper">分账公式</div>
|
|
|
|
|
</n-tag>
|
|
|
|
|
<n-input class="form_input_wrapper" v-model:value="update_data.formula"></n-input>
|
|
|
|
|
<n-input :autosize="{
|
|
|
|
|
minRows: 10,
|
|
|
|
|
maxRows: 10
|
|
|
|
|
}" type="textarea" class="form_textarea_wrapper"
|
|
|
|
|
v-model:value="update_data.formula"></n-input>
|
|
|
|
|
</n-space>
|
|
|
|
|
<n-space mt-2 align="center">
|
|
|
|
|
<n-tag>
|
|
|
|
|
<div class="form_tag_wrapper">最大分账</div>
|
|
|
|
|
<div class="form_tag_wrapper">分账测试</div>
|
|
|
|
|
</n-tag>
|
|
|
|
|
<n-input-number :mix="0" class="form_input_wrapper" v-model:value="update_data.max"></n-input-number>
|
|
|
|
|
<n-input class="form_input_wrapper" v-model:value="test_data.in_value" placeholder="入参"></n-input>
|
|
|
|
|
<n-button @click="ProfitsharingTest()" type="info">计算</n-button>
|
|
|
|
|
<n-input class="form_input_wrapper" v-model:value="test_data.out_value" placeholder="测试结果"></n-input>
|
|
|
|
|
</n-space>
|
|
|
|
|
<n-space mt-2 align="center">
|
|
|
|
|
<n-tag>
|
|
|
|
|
@ -272,13 +296,19 @@ onMounted(() => {
|
|
|
|
|
<n-tag>
|
|
|
|
|
<div class="form_tag_wrapper">分账公式</div>
|
|
|
|
|
</n-tag>
|
|
|
|
|
<n-input class="form_input_wrapper" v-model:value="create_data.formula"></n-input>
|
|
|
|
|
<n-input :autosize="{
|
|
|
|
|
minRows: 10,
|
|
|
|
|
maxRows: 10
|
|
|
|
|
}" type="textarea" class="form_textarea_wrapper"
|
|
|
|
|
v-model:value="create_data.formula"></n-input>
|
|
|
|
|
</n-space>
|
|
|
|
|
<n-space mt-2 align="center">
|
|
|
|
|
<n-tag>
|
|
|
|
|
<div class="form_tag_wrapper">最大分账</div>
|
|
|
|
|
<div class="form_tag_wrapper">分账测试</div>
|
|
|
|
|
</n-tag>
|
|
|
|
|
<n-input-number :mix="0" class="form_input_wrapper" v-model:value="create_data.max"></n-input-number>
|
|
|
|
|
<n-input class="form_input_wrapper" v-model:value="test_data.in_value" placeholder="入参"></n-input>
|
|
|
|
|
<n-button @click="ProfitsharingTest()" type="info">计算</n-button>
|
|
|
|
|
<n-input class="form_input_wrapper" v-model:value="test_data.out_value" placeholder="测试结果"></n-input>
|
|
|
|
|
</n-space>
|
|
|
|
|
<n-space mt-2 align="center">
|
|
|
|
|
<n-tag>
|
|
|
|
|
@ -303,8 +333,9 @@ onMounted(() => {
|
|
|
|
|
|
|
|
|
|
<n-card mt-2 title="分账管理">
|
|
|
|
|
<div>
|
|
|
|
|
<n-alert title="使用前请务必前往微信支付后台开通分账功能,且配置管理分账接收方。接收方商家 - 分账接收设置 - 分账回退设置
|
|
|
|
|
<n-alert v-if="profitsharing_type !== 3" title="如果使用微信分账,使用前请务必前往微信支付后台开通分账功能,且配置管理分账接收方。接收方商家 - 分账接收设置 - 分账回退设置
|
|
|
|
|
需保持开启状态。" type="warning"></n-alert>
|
|
|
|
|
<n-alert v-else title="当前模式为站内分账,下列数据只做展示,后续金额需要手动进行分账。" type="warning"></n-alert>
|
|
|
|
|
<n-alert mt-2 v-if="!profitsharing_status" title="请先前往「额外配置」标签开启分账功能" type="error"></n-alert>
|
|
|
|
|
<div v-else mt-2>
|
|
|
|
|
<n-space>
|
|
|
|
|
@ -320,4 +351,7 @@ onMounted(() => {
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<style scoped>
|
|
|
|
|
.form_textarea_wrapper {
|
|
|
|
|
width: 300px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|