Merge branch 'master' of http://gitea.zianxin.com/zianxin-tec/biz-pc-cloud
This commit is contained in:
commit
4d3bed7061
12 files changed
+194
-79
No files matched your search
File renamed without changes.
@@ -2,7 +2,7 @@ import request from "/@/utils/request"
|
||||
|
||||
export function pageJoin(query?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-mch-config/page-join",
|
||||
url: "/wallet/mch-rule-join/page-join",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
@@ -10,7 +10,7 @@ export function pageJoin(query?: Object) {
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-mch-config/page",
|
||||
url: "/wallet/mch-rule-join/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
@@ -18,7 +18,7 @@ export function fetchList(query?: Object) {
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-mch-config",
|
||||
url: "/wallet/mch-rule-join",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
@@ -26,14 +26,14 @@ export function addObj(obj?: Object) {
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-mch-config/" + id,
|
||||
url: "/wallet/mch-rule-join/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-mch-config",
|
||||
url: "/wallet/mch-rule-join",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
@@ -41,7 +41,7 @@ export function delObjs(ids?: Object) {
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-mch-config",
|
||||
url: "/wallet/mch-rule-join",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
+13
-5
@@ -2,7 +2,15 @@ import request from "/@/utils/request"
|
||||
|
||||
export function fetchList(query?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-price-config/page",
|
||||
url: "/wallet/mch-rule-price-config/page",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
}
|
||||
|
||||
export function pageSelect(query?: Object) {
|
||||
return request({
|
||||
url: "/wallet/mch-rule-price-config/page-select",
|
||||
method: "get",
|
||||
params: query,
|
||||
})
|
||||
@@ -10,7 +18,7 @@ export function fetchList(query?: Object) {
|
||||
|
||||
export function addObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-price-config",
|
||||
url: "/wallet/mch-rule-price-config",
|
||||
method: "post",
|
||||
data: obj,
|
||||
})
|
||||
@@ -18,14 +26,14 @@ export function addObj(obj?: Object) {
|
||||
|
||||
export function getObj(id?: string) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-price-config/" + id,
|
||||
url: "/wallet/mch-rule-price-config/" + id,
|
||||
method: "get",
|
||||
})
|
||||
}
|
||||
|
||||
export function delObjs(ids?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-price-config",
|
||||
url: "/wallet/mch-rule-price-config",
|
||||
method: "delete",
|
||||
data: ids,
|
||||
})
|
||||
@@ -33,7 +41,7 @@ export function delObjs(ids?: Object) {
|
||||
|
||||
export function putObj(obj?: Object) {
|
||||
return request({
|
||||
url: "/wallet/wallet-rule-price-config",
|
||||
url: "/wallet/mch-rule-price-config",
|
||||
method: "put",
|
||||
data: obj,
|
||||
})
|
||||
@@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<el-select
|
||||
style="width: 100%"
|
||||
v-model="state.selectId"
|
||||
:placeholder="props.placeholder"
|
||||
clearable
|
||||
remote-show-suffix
|
||||
filterable
|
||||
remote
|
||||
:remote-method="remoteSearch"
|
||||
:loading="state.loading"
|
||||
@visible-change="(e: boolean) => e && getOptions()"
|
||||
>
|
||||
<el-option v-for="v in state.options" :key="v.id" :label="getDictById(v.rulePriceType, v)" :value="v.rulePriceType">
|
||||
<div class="flex items-center">
|
||||
<div class="flex items-center ml5">
|
||||
<dict-tag :options="state.walletRulePriceType" :value="v.rulePriceType" />
|
||||
<div class="ml-2">
|
||||
<span>超过</span>
|
||||
<span class="color-success">{{ displayPrice(v.basePrice) }}</span>
|
||||
<span>额外支付</span>
|
||||
<span class="color-danger">{{ v.multiple }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="select-mch-rule">
|
||||
import { reactive } from "vue"
|
||||
import * as mchRulePriceConfigApi from "/@/api/wallet/mch-rule-price-config"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
const selectId = defineModel()
|
||||
|
||||
export type Props = {
|
||||
placeholder?: string
|
||||
apiParams?: any
|
||||
}
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
placeholder: "请选择",
|
||||
apiParams: {},
|
||||
})
|
||||
|
||||
const queryForm = reactive<any>({
|
||||
name: null,
|
||||
current: 1,
|
||||
size: 10,
|
||||
})
|
||||
|
||||
const state = reactive<any>({
|
||||
loading: true,
|
||||
selectId: selectId,
|
||||
options: [],
|
||||
walletRulePriceType: [],
|
||||
})
|
||||
|
||||
watch(
|
||||
selectId,
|
||||
(newVal, oldValue) => {
|
||||
if (newVal == oldValue) return
|
||||
state.selectId = newVal
|
||||
getOptions()
|
||||
},
|
||||
{ immediate: true },
|
||||
)
|
||||
|
||||
async function getOptions() {
|
||||
try {
|
||||
state.loading = true
|
||||
const _pa = {
|
||||
...queryForm,
|
||||
...props.apiParams,
|
||||
}
|
||||
const { data } = await mchRulePriceConfigApi.pageSelect(_pa)
|
||||
state.options = data.records ?? []
|
||||
|
||||
const { wallet_rule_price_type } = useDict("wallet_rule_price_type")
|
||||
state.walletRulePriceType = wallet_rule_price_type
|
||||
} finally {
|
||||
setTimeout(() => (state.loading = false), 500)
|
||||
}
|
||||
}
|
||||
|
||||
function remoteSearch(params: string) {
|
||||
if (params != queryForm.name) {
|
||||
queryForm.name = params
|
||||
getOptions()
|
||||
}
|
||||
}
|
||||
|
||||
function getDictById(value: any, v) {
|
||||
if (!value) return ""
|
||||
const target = state.walletRulePriceType.find((v: any) => v.value == value)
|
||||
if (!target) return ""
|
||||
return `${target.label} 超过${displayPrice(v.basePrice)},额外支付${v.multiple}%`
|
||||
}
|
||||
|
||||
function clear() {
|
||||
state.selectId = null
|
||||
getOptions()
|
||||
}
|
||||
</script>
|
||||
@@ -24,6 +24,7 @@ import SelectCtcgol from "/@/components/Select/SelectCtcgol.vue"
|
||||
import SelectHardGroup from "/@/components/Select/selectHardGroup.vue"
|
||||
import SelectHandlerUser from "/@/components/Select/SelectHandlerUser.vue"
|
||||
import SelectSupplier from "/@/components/Select/SelectSupplier.vue"
|
||||
import SelectMchRule from "/@/components/Select/SelectMchRule.vue"
|
||||
|
||||
// 第三方组件
|
||||
import ElementPlus from "element-plus"
|
||||
@@ -70,6 +71,7 @@ export default {
|
||||
app.component("SelectHardGroup", SelectHardGroup)
|
||||
app.component("SelectHandlerUser", SelectHandlerUser)
|
||||
app.component("SelectSupplier", SelectSupplier)
|
||||
app.component("SelectMchRule", SelectMchRule)
|
||||
|
||||
// 导入全部的elmenet-plus的图标
|
||||
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
||||
|
||||
@@ -30,10 +30,10 @@
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="MchDeptUserDialog">
|
||||
<script setup lang="ts" name="MchDeptDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/wallet/mch-dept-user"
|
||||
import { getObj, addObj, putObj } from "/@/api/wallet/mch-dept"
|
||||
import { rule } from "/@/utils/validate"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
@@ -86,9 +86,9 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemMchDeptUser">
|
||||
<script setup lang="ts" name="systemMchDept">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import * as mchDeptUserApi from "/@/api/wallet/mch-dept-user"
|
||||
import * as mchDeptUserApi from "/@/api/wallet/mch-dept"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { ro } from "element-plus/es/locale"
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-dialog :title="form.id ? '编辑' : '新增'" width="30%" v-model="visible" :close-on-click-modal="false" draggable>
|
||||
<el-form ref="dataFormRef" :model="form" :rules="dataRules" formDialogRef label-width="90px" v-loading="loading">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="规则" prop="rulePriceConfigId">
|
||||
<el-input v-model="form.rulePriceConfigId" placeholder="规则" />
|
||||
<select-mch-rule v-model="form.rulePriceConfigId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" class="mb20">
|
||||
<el-form-item label="目标商户" prop="tragetDeptId">
|
||||
<el-input v-model="form.tragetDeptId" placeholder="请输入目标商户id" />
|
||||
<select-mch v-model="form.tragetDeptId" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -26,7 +26,7 @@
|
||||
<script setup lang="ts" name="WalletRuleMchConfigFormDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import * as walletRuleMchConfigApi from "/@/api/wallet/wallet-rule-mch-config"
|
||||
import * as walletRuleMchConfigApi from "../../../api/wallet/mch-rule-join"
|
||||
import { rule } from "/@/utils/validate"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="mchRuleConfigDialog">
|
||||
import * as walletRuleMchConfigApi from "/@/api/wallet/wallet-rule-mch-config"
|
||||
import * as walletRuleMchConfigApi from "../../../api/wallet/mch-rule-join"
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<script setup lang="ts" name="WalletRulePriceConfigDialog">
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
import { useMessage } from "/@/hooks/message"
|
||||
import { getObj, addObj, putObj } from "/@/api/wallet/wallet-rule-price-config"
|
||||
import { getObj, addObj, putObj } from "../../../api/wallet/mch-rule-price-config"
|
||||
import { storePrice, displayPrice } from "/@/utils/formatMoney"
|
||||
const emit = defineEmits(["refresh"])
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
|
||||
<script setup lang="ts" name="systemWalletRulePriceConfig">
|
||||
import { BasicTableProps, useTable } from "/@/hooks/table"
|
||||
import { fetchList, delObjs } from "/@/api/wallet/wallet-rule-price-config"
|
||||
import { fetchList, delObjs } from "../../../api/wallet/mch-rule-price-config"
|
||||
import { useMessage, useMessageBox } from "/@/hooks/message"
|
||||
import { displayPrice } from "/@/utils/formatMoney"
|
||||
import { useDict } from "/@/hooks/dict"
|
||||
|
||||
Reference in new issue
Block a user