Compare commits
2 Commits
cc01095107
...
ac9712819a
| Author | SHA1 | Date | |
|---|---|---|---|
| ac9712819a | |||
| 91708315f3 |
@@ -9,12 +9,12 @@ VITE_FILE_SERVER=https://your-file-server.com
|
||||
# AI 网关(OpenAI兼容)
|
||||
# - 开发环境推荐走同源反代:VITE_AI_API_URL=/ai-proxy(配合 vite.config.ts)
|
||||
# - 生产环境可直连(需 AI 服务允许 CORS),或在 Nginx 里配置 /ai-proxy 反代
|
||||
VITE_AI_API_URL=https://ai-api.websoft.top/api/v1
|
||||
VITE_AI_API_URL=http://127.0.0.1:11434/api/v1
|
||||
|
||||
# Ollama 原生接口(默认端口 11434)
|
||||
# - 开发环境推荐走同源反代:VITE_OLLAMA_API_URL=/proxy(配合 vite.config.ts)
|
||||
# - 生产环境不要直接用 http(会混合内容被拦截),建议 Nginx 反代成同源 https
|
||||
VITE_OLLAMA_API_URL=http://47.119.165.234:11434
|
||||
VITE_OLLAMA_API_URL=http://127.0.0.1:11434
|
||||
|
||||
# 仅用于本地开发反代注入(vite.config.ts 会读取并注入到 /ai-proxy 请求头)
|
||||
# 不要加 VITE_ 前缀,避免被打包到前端产物里
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
项目已在 `vite.config.ts` 配置(默认目标可通过 `AI_PROXY_TARGET` 调整):
|
||||
|
||||
- `/ai-proxy/*` -> `https://ai-api.websoft.top/api/v1/*`
|
||||
- `/ai-proxy/*` -> `http://127.0.0.1:11434/api/v1/*`
|
||||
|
||||
配合 `.env.development`:
|
||||
|
||||
@@ -20,7 +20,7 @@ VITE_AI_API_URL=/ai-proxy
|
||||
|
||||
```nginx
|
||||
location /ai-proxy/ {
|
||||
proxy_pass https://ai-api.websoft.top/api/v1/;
|
||||
proxy_pass http://127.0.0.1:11434/api/v1/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host ai-api.websoft.top;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -48,9 +48,9 @@ VITE_AI_API_URL=/ai-proxy
|
||||
|
||||
```nginx
|
||||
location /proxy/ {
|
||||
proxy_pass http://47.119.165.234:11434/;
|
||||
proxy_pass http://127.0.0.1:11434/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host 47.119.165.234;
|
||||
proxy_set_header Host 127.0.0.1;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
@@ -48,7 +48,9 @@ export async function listOllamaModels(opts?: { baseURL?: string }) {
|
||||
if (!res.ok) {
|
||||
const text = await res.text().catch(() => '');
|
||||
throw new Error(
|
||||
`listOllamaModels failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}`
|
||||
`listOllamaModels failed: ${res.status} ${res.statusText}${
|
||||
text ? ` - ${text}` : ''
|
||||
}`
|
||||
);
|
||||
}
|
||||
return (await res.json()) as OllamaTagsResponse;
|
||||
@@ -68,7 +70,9 @@ export async function ollamaChat(
|
||||
if (!res.ok) {
|
||||
const text = await res.text().catch(() => '');
|
||||
throw new Error(
|
||||
`ollamaChat failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}`
|
||||
`ollamaChat failed: ${res.status} ${res.statusText}${
|
||||
text ? ` - ${text}` : ''
|
||||
}`
|
||||
);
|
||||
}
|
||||
return (await res.json()) as OllamaChatResponseChunk;
|
||||
@@ -97,7 +101,9 @@ export async function ollamaChatStream(
|
||||
if (!res.ok || !res.body) {
|
||||
const text = await res.text().catch(() => '');
|
||||
throw new Error(
|
||||
`ollamaChatStream failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}`
|
||||
`ollamaChatStream failed: ${res.status} ${res.statusText}${
|
||||
text ? ` - ${text}` : ''
|
||||
}`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -143,4 +149,3 @@ export async function ollamaChatStream(
|
||||
|
||||
opts.onDone?.();
|
||||
}
|
||||
|
||||
|
||||
@@ -71,7 +71,9 @@ export async function listModels(opts?: { apiKey?: string; baseURL?: string }) {
|
||||
if (!res.ok) {
|
||||
const text = await res.text().catch(() => '');
|
||||
throw new Error(
|
||||
`listModels failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}`
|
||||
`listModels failed: ${res.status} ${res.statusText}${
|
||||
text ? ` - ${text}` : ''
|
||||
}`
|
||||
);
|
||||
}
|
||||
return (await res.json()) as OpenAIListModelsResponse;
|
||||
@@ -91,7 +93,9 @@ export async function chatCompletions(
|
||||
if (!res.ok) {
|
||||
const text = await res.text().catch(() => '');
|
||||
throw new Error(
|
||||
`chatCompletions failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}`
|
||||
`chatCompletions failed: ${res.status} ${res.statusText}${
|
||||
text ? ` - ${text}` : ''
|
||||
}`
|
||||
);
|
||||
}
|
||||
return (await res.json()) as OpenAIChatCompletionResponse;
|
||||
@@ -124,7 +128,9 @@ export async function chatCompletionsStream(
|
||||
if (!res.ok || !res.body) {
|
||||
const text = await res.text().catch(() => '');
|
||||
throw new Error(
|
||||
`chatCompletionsStream failed: ${res.status} ${res.statusText}${text ? ` - ${text}` : ''}`
|
||||
`chatCompletionsStream failed: ${res.status} ${res.statusText}${
|
||||
text ? ` - ${text}` : ''
|
||||
}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export const FILE_SERVER =
|
||||
export const AI_API_URL =
|
||||
import.meta.env.VITE_AI_API_URL ||
|
||||
// Prefer same-origin reverse proxy during local development to avoid CORS.
|
||||
(import.meta.env.DEV ? '/ai-proxy' : 'https://ai-api.websoft.top/api/v1');
|
||||
(import.meta.env.DEV ? '/ai-proxy' : 'http://127.0.0.1:11434/api/v1');
|
||||
|
||||
// Ollama native API endpoint (usually http://host:11434).
|
||||
// Note: browsers cannot call http from an https site (mixed-content); prefer same-origin proxy.
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onBeforeUnmount, ref } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { OLLAMA_API_URL } from '@/config/setting';
|
||||
import {
|
||||
listOllamaModels,
|
||||
ollamaChat,
|
||||
@@ -11,8 +10,11 @@
|
||||
|
||||
type Msg = OllamaChatMessage;
|
||||
|
||||
// Only keep Ollama native API mode.
|
||||
const baseURL = ref<string>(OLLAMA_API_URL);
|
||||
// Hardcode endpoint to avoid going through mp.websoft.top `/proxy`.
|
||||
// The API methods append `/api/*` paths.
|
||||
const BASE_URL = import.meta.env.PROD
|
||||
? 'http://127.0.0.1:11434'
|
||||
: 'https://ai-api.websoft.top';
|
||||
|
||||
const modelLoading = ref(false);
|
||||
const models = ref<Array<{ id: string; name?: string }>>([]);
|
||||
@@ -46,11 +48,8 @@
|
||||
modelLoading.value = true;
|
||||
errorText.value = '';
|
||||
try {
|
||||
if (!baseURL.value.trim()) {
|
||||
baseURL.value = OLLAMA_API_URL;
|
||||
}
|
||||
const res = await listOllamaModels({
|
||||
baseURL: baseURL.value.trim() || OLLAMA_API_URL
|
||||
baseURL: BASE_URL
|
||||
});
|
||||
models.value = (res.models ?? []).map((m) => ({
|
||||
id: m.name,
|
||||
@@ -100,7 +99,7 @@
|
||||
options: { temperature: temperature.value }
|
||||
},
|
||||
{
|
||||
baseURL: baseURL.value.trim() || OLLAMA_API_URL,
|
||||
baseURL: BASE_URL,
|
||||
signal: controller.signal,
|
||||
onDelta: (t) => {
|
||||
assistantText.value += t;
|
||||
@@ -115,7 +114,7 @@
|
||||
options: { temperature: temperature.value }
|
||||
},
|
||||
{
|
||||
baseURL: baseURL.value.trim() || OLLAMA_API_URL,
|
||||
baseURL: BASE_URL,
|
||||
signal: controller.signal
|
||||
}
|
||||
);
|
||||
@@ -165,16 +164,6 @@
|
||||
description="支持Qwen3.5、DeepSeek、Gemini3等主流的开源大模型,免费使用"
|
||||
/>
|
||||
|
||||
<a-row :gutter="12">
|
||||
<a-col :xs="24" :md="12">
|
||||
<a-input
|
||||
v-model:value="baseURL"
|
||||
addon-before="BaseURL"
|
||||
placeholder="http://localhost:11434"
|
||||
/>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-row :gutter="12">
|
||||
<a-col :xs="24" :md="12">
|
||||
<a-select
|
||||
|
||||
@@ -62,9 +62,9 @@
|
||||
<div class="text-gray-400"
|
||||
>{{ record.thirdNickname || '-' }} {{ record.thirdMoney }}</div
|
||||
>
|
||||
<!-- <div class="text-gray-400" v-if="record.thirdNickname"-->
|
||||
<!-- >{{ record.thirdNickname }} {{ record.thirdMoney }}</div-->
|
||||
<!-- >-->
|
||||
<!-- <div class="text-gray-400" v-if="record.thirdNickname"-->
|
||||
<!-- >{{ record.thirdNickname }} {{ record.thirdMoney }}</div-->
|
||||
<!-- >-->
|
||||
</template>
|
||||
|
||||
<template v-if="column.key === 'dealerInfo'">
|
||||
|
||||
@@ -56,15 +56,7 @@
|
||||
// 导出
|
||||
const handleExport = async () => {
|
||||
const array: (string | number)[][] = [
|
||||
[
|
||||
'订单号',
|
||||
'用户',
|
||||
'收益类型',
|
||||
'金额',
|
||||
'描述',
|
||||
'创建时间',
|
||||
'租户ID'
|
||||
]
|
||||
['订单号', '用户', '收益类型', '金额', '描述', '创建时间', '租户ID']
|
||||
];
|
||||
|
||||
// 按搜索结果导出
|
||||
|
||||
@@ -91,7 +91,8 @@
|
||||
? `\n${d.nickname ?? '-'}(${d.userId ?? '-'})`
|
||||
: '');
|
||||
|
||||
const firstDividendUserName = (d as any)?.firstDividendUserName ?? '-';
|
||||
const firstDividendUserName =
|
||||
(d as any)?.firstDividendUserName ?? '-';
|
||||
const firstDividend = (d as any)?.firstDividend ?? 0;
|
||||
const secondDividendUserName =
|
||||
(d as any)?.secondDividendUserName ?? '-';
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
class="sys-org-table"
|
||||
>
|
||||
<template #toolbar>
|
||||
<search
|
||||
@search="reload"
|
||||
/>
|
||||
<search @search="reload" />
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'title'">
|
||||
@@ -55,16 +53,16 @@
|
||||
|
||||
<template v-if="column.key === 'firstDividendUserName'">
|
||||
<div>{{ record.firstDividend }}</div>
|
||||
<div class="text-gray-400"
|
||||
>{{ record.firstDividendUserName || '-' }}</div
|
||||
>
|
||||
<div class="text-gray-400">{{
|
||||
record.firstDividendUserName || '-'
|
||||
}}</div>
|
||||
</template>
|
||||
|
||||
<template v-if="column.key === 'secondDividendUserName'">
|
||||
<div>{{ record.secondDividend }}</div>
|
||||
<div class="text-gray-400"
|
||||
>{{ record.secondDividendUserName || '-' }}</div
|
||||
>
|
||||
<div class="text-gray-400">{{
|
||||
record.secondDividendUserName || '-'
|
||||
}}</div>
|
||||
</template>
|
||||
|
||||
<template v-if="column.key === 'dealerInfo'">
|
||||
@@ -175,9 +173,7 @@
|
||||
ShopDealerOrder,
|
||||
ShopDealerOrderParam
|
||||
} from '@/api/shop/shopDealerOrder/model';
|
||||
import {
|
||||
updateShopDealerOrder
|
||||
} from '@/api/shop/shopDealerOrder';
|
||||
import { updateShopDealerOrder } from '@/api/shop/shopDealerOrder';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
style="padding: 24px 0; margin-bottom: 16px"
|
||||
>
|
||||
<p class="ant-upload-drag-icon">
|
||||
<cloud-upload-outlined/>
|
||||
<cloud-upload-outlined />
|
||||
</p>
|
||||
<p class="ant-upload-hint">将文件拖到此处,或点击上传</p>
|
||||
</a-upload-dragger>
|
||||
@@ -24,26 +24,26 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import {message} from 'ant-design-vue/es';
|
||||
import {CloudUploadOutlined} from '@ant-design/icons-vue';
|
||||
import {importSdyDealerOrder} from "@/api/sdy/sdyDealerOrder";
|
||||
import { ref } from 'vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
import { CloudUploadOutlined } from '@ant-design/icons-vue';
|
||||
import { importSdyDealerOrder } from '@/api/sdy/sdyDealerOrder';
|
||||
|
||||
const emit = defineEmits<{
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
}>();
|
||||
|
||||
defineProps<{
|
||||
defineProps<{
|
||||
// 是否打开弹窗
|
||||
visible: boolean;
|
||||
}>();
|
||||
}>();
|
||||
|
||||
// 导入请求状态
|
||||
const loading = ref(false);
|
||||
// 导入请求状态
|
||||
const loading = ref(false);
|
||||
|
||||
/* 上传 */
|
||||
const doUpload = ({file}) => {
|
||||
/* 上传 */
|
||||
const doUpload = ({ file }) => {
|
||||
if (
|
||||
![
|
||||
'application/vnd.ms-excel',
|
||||
@@ -70,10 +70,10 @@ const doUpload = ({file}) => {
|
||||
message.error(e.message);
|
||||
});
|
||||
return false;
|
||||
};
|
||||
};
|
||||
|
||||
/* 更新 visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
/* 更新 visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -14,14 +14,17 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { GradeParam } from '@/api/user/grade/model';
|
||||
import {ref, watch} from 'vue';
|
||||
import {utils, writeFile} from 'xlsx';
|
||||
import {message} from 'ant-design-vue';
|
||||
import {ShopDealerCapital} from "@/api/shop/shopDealerCapital/model";
|
||||
import {getTenantId} from "@/utils/domain";
|
||||
import useSearch from "@/utils/use-search";
|
||||
import {ShopDealerOrder, ShopDealerOrderParam} from "@/api/sdy/sdyDealerOrder/model";
|
||||
import {pageShopDealerOrder} from "@/api/shop/shopDealerOrder";
|
||||
import { ref, watch } from 'vue';
|
||||
import { utils, writeFile } from 'xlsx';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { ShopDealerCapital } from '@/api/shop/shopDealerCapital/model';
|
||||
import { getTenantId } from '@/utils/domain';
|
||||
import useSearch from '@/utils/use-search';
|
||||
import {
|
||||
ShopDealerOrder,
|
||||
ShopDealerOrderParam
|
||||
} from '@/api/sdy/sdyDealerOrder/model';
|
||||
import { pageShopDealerOrder } from '@/api/shop/shopDealerOrder';
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
@@ -43,7 +46,7 @@
|
||||
};
|
||||
|
||||
// 表单数据
|
||||
const {where} = useSearch<ShopDealerOrderParam>({
|
||||
const { where } = useSearch<ShopDealerOrderParam>({
|
||||
keywords: '',
|
||||
userId: undefined,
|
||||
orderNo: undefined,
|
||||
@@ -114,27 +117,23 @@
|
||||
workbook.Sheets[sheetName] = sheet;
|
||||
// 设置列宽
|
||||
sheet['!cols'] = [
|
||||
{wch: 10},
|
||||
{wch: 20},
|
||||
{wch: 20},
|
||||
{wch: 15},
|
||||
{wch: 10},
|
||||
{wch: 10},
|
||||
{wch: 20}
|
||||
{ wch: 10 },
|
||||
{ wch: 20 },
|
||||
{ wch: 20 },
|
||||
{ wch: 15 },
|
||||
{ wch: 10 },
|
||||
{ wch: 10 },
|
||||
{ wch: 20 }
|
||||
];
|
||||
message.loading('正在导出...');
|
||||
setTimeout(() => {
|
||||
writeFile(
|
||||
workbook,
|
||||
`${sheetName}.xlsx`
|
||||
);
|
||||
writeFile(workbook, `${sheetName}.xlsx`);
|
||||
}, 1000);
|
||||
})
|
||||
.catch((msg) => {
|
||||
message.error(msg);
|
||||
})
|
||||
.finally(() => {
|
||||
});
|
||||
.finally(() => {});
|
||||
};
|
||||
|
||||
watch(
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
>
|
||||
<!-- 订单基本信息 -->
|
||||
<a-divider orientation="left">
|
||||
<span style="color: #1890ff; font-weight: 600;">基本信息</span>
|
||||
<span style="color: #1890ff; font-weight: 600">基本信息</span>
|
||||
</a-divider>
|
||||
|
||||
<a-row :gutter="16">
|
||||
@@ -68,13 +68,25 @@
|
||||
<div class="font-bold text-gray-400 bg-gray-50">开发调试</div>
|
||||
<div class="text-gray-400 bg-gray-50">
|
||||
<div>业务员({{ form.userId }}):{{ form.nickname }}</div>
|
||||
<div>一级分销商({{ form.firstUserId }}):{{ form.firstNickname }},一级佣金30%:{{ form.firstMoney }}</div>
|
||||
<div>二级分销商({{ form.secondUserId }}):{{ form.secondNickname }},二级佣金10%:{{ form.secondMoney }}</div>
|
||||
<div>三级分销商({{ form.thirdUserId }}):{{ form.thirdNickname }},三级佣金60%:{{ form.thirdMoney }}</div>
|
||||
<div
|
||||
>一级分销商({{ form.firstUserId }}):{{
|
||||
form.firstNickname
|
||||
}},一级佣金30%:{{ form.firstMoney }}</div
|
||||
>
|
||||
<div
|
||||
>二级分销商({{ form.secondUserId }}):{{
|
||||
form.secondNickname
|
||||
}},二级佣金10%:{{ form.secondMoney }}</div
|
||||
>
|
||||
<div
|
||||
>三级分销商({{ form.thirdUserId }}):{{
|
||||
form.thirdNickname
|
||||
}},三级佣金60%:{{ form.thirdMoney }}</div
|
||||
>
|
||||
</div>
|
||||
<!-- 分销商信息 -->
|
||||
<a-divider orientation="left">
|
||||
<span style="color: #1890ff; font-weight: 600;">收益计算</span>
|
||||
<span style="color: #1890ff; font-weight: 600">收益计算</span>
|
||||
</a-divider>
|
||||
|
||||
<!-- 一级分销商 -->
|
||||
@@ -117,9 +129,7 @@
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="占比" name="rate">
|
||||
10%
|
||||
</a-form-item>
|
||||
<a-form-item label="占比" name="rate"> 10% </a-form-item>
|
||||
<a-form-item label="获取收益" name="firstMoney">
|
||||
{{ form.secondMoney }}
|
||||
</a-form-item>
|
||||
@@ -152,47 +162,50 @@
|
||||
</a-row>
|
||||
</div>
|
||||
|
||||
<a-form-item label="结算时间" name="settleTime" v-if="form.isSettled === 1">
|
||||
<a-form-item
|
||||
label="结算时间"
|
||||
name="settleTime"
|
||||
v-if="form.isSettled === 1"
|
||||
>
|
||||
{{ form.settleTime }}
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
|
||||
</ele-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {ref, reactive, watch} from 'vue';
|
||||
import {Form, message} from 'ant-design-vue';
|
||||
import {assignObject} from 'ele-admin-pro';
|
||||
import {ShopDealerOrder} from '@/api/shop/shopDealerOrder/model';
|
||||
import {FormInstance} from 'ant-design-vue/es/form';
|
||||
import {updateSdyDealerOrder} from "@/api/sdy/sdyDealerOrder";
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject } from 'ele-admin-pro';
|
||||
import { ShopDealerOrder } from '@/api/shop/shopDealerOrder/model';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { updateSdyDealerOrder } from '@/api/sdy/sdyDealerOrder';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
const useForm = Form.useForm;
|
||||
|
||||
const props = defineProps<{
|
||||
const props = defineProps<{
|
||||
// 弹窗是否打开
|
||||
visible: boolean;
|
||||
// 修改回显的数据
|
||||
data?: ShopDealerOrder | null;
|
||||
}>();
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
const emit = defineEmits<{
|
||||
(e: 'done'): void;
|
||||
(e: 'update:visible', visible: boolean): void;
|
||||
}>();
|
||||
}>();
|
||||
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
// 提交状态
|
||||
const loading = ref(false);
|
||||
// 是否显示最大化切换按钮
|
||||
const maxable = ref(true);
|
||||
// 表格选中数据
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
|
||||
// 表单数据
|
||||
const form = reactive<ShopDealerOrder>({
|
||||
// 表单数据
|
||||
const form = reactive<ShopDealerOrder>({
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
nickname: undefined,
|
||||
@@ -221,29 +234,28 @@ const form = reactive<ShopDealerOrder>({
|
||||
tenantId: undefined,
|
||||
createTime: undefined,
|
||||
updateTime: undefined
|
||||
});
|
||||
});
|
||||
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
/* 更新visible */
|
||||
const updateVisible = (value: boolean) => {
|
||||
emit('update:visible', value);
|
||||
};
|
||||
};
|
||||
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
// 表单验证规则
|
||||
const rules = reactive({
|
||||
userId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择用户ID',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
});
|
||||
]
|
||||
});
|
||||
|
||||
const { resetFields } = useForm(form, rules);
|
||||
|
||||
const {resetFields} = useForm(form, rules);
|
||||
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
/* 保存编辑 */
|
||||
const save = () => {
|
||||
if (!formRef.value) {
|
||||
return;
|
||||
}
|
||||
@@ -275,12 +287,11 @@ const save = () => {
|
||||
message.error(e.message);
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
};
|
||||
.catch(() => {});
|
||||
};
|
||||
|
||||
console.log(localStorage.getItem(''))
|
||||
watch(
|
||||
console.log(localStorage.getItem(''));
|
||||
watch(
|
||||
() => props.visible,
|
||||
(visible) => {
|
||||
if (visible) {
|
||||
@@ -310,12 +321,12 @@ watch(
|
||||
resetFields();
|
||||
}
|
||||
},
|
||||
{immediate: true}
|
||||
);
|
||||
{ immediate: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.dealer-section {
|
||||
.dealer-section {
|
||||
margin-bottom: 24px;
|
||||
padding: 16px;
|
||||
background: #fafafa;
|
||||
@@ -332,21 +343,21 @@ watch(
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-divider-horizontal.ant-divider-with-text-left) {
|
||||
:deep(.ant-divider-horizontal.ant-divider-with-text-left) {
|
||||
margin: 24px 0 16px 0;
|
||||
|
||||
.ant-divider-inner-text {
|
||||
padding: 0 16px 0 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-form-item) {
|
||||
:deep(.ant-form-item) {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-input-number) {
|
||||
:deep(.ant-input-number) {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
/>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
|
||||
<template v-if="column.key === 'title'">
|
||||
<div>{{ record.title }}</div>
|
||||
<div class="text-gray-400">业务员:{{ record.userId }}</div>
|
||||
@@ -51,15 +50,21 @@
|
||||
<div class="dealer-info">
|
||||
<div v-if="record.firstUserId" class="dealer-level">
|
||||
<a-tag color="red">一级</a-tag>
|
||||
用户{{ record.firstUserId }} - ¥{{ parseFloat(record.firstMoney || '0').toFixed(2) }}
|
||||
用户{{ record.firstUserId }} - ¥{{
|
||||
parseFloat(record.firstMoney || '0').toFixed(2)
|
||||
}}
|
||||
</div>
|
||||
<div v-if="record.secondUserId" class="dealer-level">
|
||||
<a-tag color="orange">二级</a-tag>
|
||||
用户{{ record.secondUserId }} - ¥{{ parseFloat(record.secondMoney || '0').toFixed(2) }}
|
||||
用户{{ record.secondUserId }} - ¥{{
|
||||
parseFloat(record.secondMoney || '0').toFixed(2)
|
||||
}}
|
||||
</div>
|
||||
<div v-if="record.thirdUserId" class="dealer-level">
|
||||
<a-tag color="gold">三级</a-tag>
|
||||
用户{{ record.thirdUserId }} - ¥{{ parseFloat(record.thirdMoney || '0').toFixed(2) }}
|
||||
用户{{ record.thirdUserId }} - ¥{{
|
||||
parseFloat(record.thirdMoney || '0').toFixed(2)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -90,28 +95,26 @@
|
||||
<a @click="settleOrder(record)" class="ele-text-success">
|
||||
结算
|
||||
</a>
|
||||
<a-divider type="vertical"/>
|
||||
<a-divider type="vertical" />
|
||||
</template>
|
||||
<!-- <template v-if="record.isInvalid === 0">-->
|
||||
<!-- <a-popconfirm-->
|
||||
<!-- title="确定要标记此订单为失效吗?"-->
|
||||
<!-- @confirm="invalidateOrder(record)"-->
|
||||
<!-- placement="topRight"-->
|
||||
<!-- >-->
|
||||
<!-- <a class="text-purple-500">-->
|
||||
<!-- 验证-->
|
||||
<!-- </a>-->
|
||||
<!-- </a-popconfirm>-->
|
||||
<!-- </template>-->
|
||||
<!-- <template v-if="record.isInvalid === 0">-->
|
||||
<!-- <a-popconfirm-->
|
||||
<!-- title="确定要标记此订单为失效吗?"-->
|
||||
<!-- @confirm="invalidateOrder(record)"-->
|
||||
<!-- placement="topRight"-->
|
||||
<!-- >-->
|
||||
<!-- <a class="text-purple-500">-->
|
||||
<!-- 验证-->
|
||||
<!-- </a>-->
|
||||
<!-- </a-popconfirm>-->
|
||||
<!-- </template>-->
|
||||
<a-popconfirm
|
||||
v-if="record.isSettled === 0"
|
||||
title="确定要删除吗?"
|
||||
@confirm="remove(record)"
|
||||
placement="topRight"
|
||||
>
|
||||
<a class="text-red-500">
|
||||
删除
|
||||
</a>
|
||||
<a class="text-red-500"> 删除 </a>
|
||||
</a-popconfirm>
|
||||
</template>
|
||||
</template>
|
||||
@@ -119,46 +122,60 @@
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ShopDealerOrderEdit v-model:visible="showEdit" :data="current" @done="reload"/>
|
||||
<ShopDealerOrderEdit
|
||||
v-model:visible="showEdit"
|
||||
:data="current"
|
||||
@done="reload"
|
||||
/>
|
||||
</a-page-header>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {createVNode, ref} from 'vue';
|
||||
import {message, Modal} from 'ant-design-vue';
|
||||
import {
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import {
|
||||
ExclamationCircleOutlined,
|
||||
DollarOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
import type {EleProTable} from 'ele-admin-pro';
|
||||
import type {
|
||||
DollarOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import type {
|
||||
DatasourceFunction,
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import ShopDealerOrderEdit from './components/shopDealerOrderEdit.vue';
|
||||
import {pageShopDealerOrder, removeShopDealerOrder, removeBatchShopDealerOrder} from '@/api/shop/shopDealerOrder';
|
||||
import type {ShopDealerOrder, ShopDealerOrderParam} from '@/api/shop/shopDealerOrder/model';
|
||||
import {exportSdyDealerOrder, updateSdyDealerOrder} from "@/api/sdy/sdyDealerOrder";
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import { getPageTitle } from '@/utils/common';
|
||||
import ShopDealerOrderEdit from './components/shopDealerOrderEdit.vue';
|
||||
import {
|
||||
pageShopDealerOrder,
|
||||
removeShopDealerOrder,
|
||||
removeBatchShopDealerOrder
|
||||
} from '@/api/shop/shopDealerOrder';
|
||||
import type {
|
||||
ShopDealerOrder,
|
||||
ShopDealerOrderParam
|
||||
} from '@/api/shop/shopDealerOrder/model';
|
||||
import {
|
||||
exportSdyDealerOrder,
|
||||
updateSdyDealerOrder
|
||||
} from '@/api/sdy/sdyDealerOrder';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
|
||||
// 表格选中数据
|
||||
const selection = ref<ShopDealerOrder[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ShopDealerOrder | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
// 表格选中数据
|
||||
const selection = ref<ShopDealerOrder[]>([]);
|
||||
// 当前编辑数据
|
||||
const current = ref<ShopDealerOrder | null>(null);
|
||||
// 是否显示编辑弹窗
|
||||
const showEdit = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
|
||||
// 当前搜索条件
|
||||
const currentWhere = ref<ShopDealerOrderParam>({});
|
||||
// 当前搜索条件
|
||||
const currentWhere = ref<ShopDealerOrderParam>({});
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit,
|
||||
where,
|
||||
@@ -169,7 +186,7 @@ const datasource: DatasourceFunction = ({
|
||||
where.status = filters.status;
|
||||
}
|
||||
// 保存当前搜索条件用于导出
|
||||
currentWhere.value = {...where};
|
||||
currentWhere.value = { ...where };
|
||||
// 已结算订单
|
||||
where.isSettled = 1;
|
||||
return pageShopDealerOrder({
|
||||
@@ -178,17 +195,17 @@ const datasource: DatasourceFunction = ({
|
||||
page,
|
||||
limit
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
// 表格列配置
|
||||
const columns = ref<ColumnItem[]>([
|
||||
{
|
||||
key: 'index',
|
||||
width: 48,
|
||||
align: 'center',
|
||||
fixed: 'left',
|
||||
hideInSetting: true,
|
||||
customRender: ({index}) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
customRender: ({ index }) => index + (tableRef.value?.tableIndex ?? 0)
|
||||
},
|
||||
{
|
||||
title: '客户名称',
|
||||
@@ -273,19 +290,21 @@ const columns = ref<ColumnItem[]>([
|
||||
// align: 'center',
|
||||
// hideInSetting: true
|
||||
// }
|
||||
]);
|
||||
]);
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: ShopDealerOrderParam) => {
|
||||
/* 搜索 */
|
||||
const reload = (where?: ShopDealerOrderParam) => {
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({where: where});
|
||||
};
|
||||
tableRef?.value?.reload({ where: where });
|
||||
};
|
||||
|
||||
/* 结算单个订单 */
|
||||
const settleOrder = (row: ShopDealerOrder) => {
|
||||
const totalCommission = (parseFloat(row.firstMoney || '0') +
|
||||
/* 结算单个订单 */
|
||||
const settleOrder = (row: ShopDealerOrder) => {
|
||||
const totalCommission = (
|
||||
parseFloat(row.firstMoney || '0') +
|
||||
parseFloat(row.secondMoney || '0') +
|
||||
parseFloat(row.thirdMoney || '0')).toFixed(2);
|
||||
parseFloat(row.thirdMoney || '0')
|
||||
).toFixed(2);
|
||||
|
||||
Modal.confirm({
|
||||
title: '确认结算',
|
||||
@@ -300,7 +319,7 @@ const settleOrder = (row: ShopDealerOrder) => {
|
||||
updateSdyDealerOrder({
|
||||
...row,
|
||||
isSettled: 1
|
||||
})
|
||||
});
|
||||
setTimeout(() => {
|
||||
hide();
|
||||
message.success('结算成功');
|
||||
@@ -308,17 +327,17 @@ const settleOrder = (row: ShopDealerOrder) => {
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/* 批量结算 */
|
||||
const batchSettle = () => {
|
||||
/* 批量结算 */
|
||||
const batchSettle = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
}
|
||||
|
||||
const validOrders = selection.value.filter(order =>
|
||||
order.isSettled === 0 && order.isInvalid === 0
|
||||
const validOrders = selection.value.filter(
|
||||
(order) => order.isSettled === 0 && order.isInvalid === 0
|
||||
);
|
||||
|
||||
if (!validOrders.length) {
|
||||
@@ -326,11 +345,16 @@ const batchSettle = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
const totalCommission = validOrders.reduce((sum, order) => {
|
||||
return sum + parseFloat(order.firstMoney || '0') +
|
||||
const totalCommission = validOrders
|
||||
.reduce((sum, order) => {
|
||||
return (
|
||||
sum +
|
||||
parseFloat(order.firstMoney || '0') +
|
||||
parseFloat(order.secondMoney || '0') +
|
||||
parseFloat(order.thirdMoney || '0');
|
||||
}, 0).toFixed(2);
|
||||
parseFloat(order.thirdMoney || '0')
|
||||
);
|
||||
}, 0)
|
||||
.toFixed(2);
|
||||
|
||||
Modal.confirm({
|
||||
title: '批量结算确认',
|
||||
@@ -349,22 +373,22 @@ const batchSettle = () => {
|
||||
}, 1500);
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/* 导出数据 */
|
||||
const handleExport = () => {
|
||||
/* 导出数据 */
|
||||
const handleExport = () => {
|
||||
// 调用导出API,传入当前搜索条件
|
||||
exportSdyDealerOrder(currentWhere.value);
|
||||
};
|
||||
};
|
||||
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ShopDealerOrder) => {
|
||||
/* 打开编辑弹窗 */
|
||||
const openEdit = (row?: ShopDealerOrder) => {
|
||||
current.value = row ?? null;
|
||||
showEdit.value = true;
|
||||
};
|
||||
};
|
||||
|
||||
/* 删除单个 */
|
||||
const remove = (row: ShopDealerOrder) => {
|
||||
/* 删除单个 */
|
||||
const remove = (row: ShopDealerOrder) => {
|
||||
const hide = message.loading('请求中..', 0);
|
||||
removeShopDealerOrder(row.id)
|
||||
.then((msg) => {
|
||||
@@ -376,10 +400,10 @@ const remove = (row: ShopDealerOrder) => {
|
||||
hide();
|
||||
message.error(e.message);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
/* 批量删除 */
|
||||
const removeBatch = () => {
|
||||
if (!selection.value.length) {
|
||||
message.error('请至少选择一条数据');
|
||||
return;
|
||||
@@ -403,15 +427,15 @@ const removeBatch = () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
/* 查询 */
|
||||
const query = () => {
|
||||
loading.value = true;
|
||||
};
|
||||
};
|
||||
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ShopDealerOrder) => {
|
||||
/* 自定义行属性 */
|
||||
const customRow = (record: ShopDealerOrder) => {
|
||||
return {
|
||||
// 行点击事件
|
||||
onClick: () => {
|
||||
@@ -422,18 +446,18 @@ const customRow = (record: ShopDealerOrder) => {
|
||||
openEdit(record);
|
||||
}
|
||||
};
|
||||
};
|
||||
query();
|
||||
};
|
||||
query();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
export default {
|
||||
export default {
|
||||
name: 'ShopDealerOrder'
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.order-info {
|
||||
.order-info {
|
||||
.order-id {
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
@@ -444,9 +468,9 @@ export default {
|
||||
color: #ff4d4f;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.dealer-info {
|
||||
.dealer-info {
|
||||
.dealer-level {
|
||||
margin-bottom: 6px;
|
||||
font-size: 12px;
|
||||
@@ -455,9 +479,9 @@ export default {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.detail-section) {
|
||||
:deep(.detail-section) {
|
||||
h4 {
|
||||
color: #1890ff;
|
||||
margin-bottom: 12px;
|
||||
@@ -469,13 +493,13 @@ export default {
|
||||
margin: 4px 0;
|
||||
line-height: 1.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-table-tbody > tr > td) {
|
||||
:deep(.ant-table-tbody > tr > td) {
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-tag) {
|
||||
:deep(.ant-tag) {
|
||||
margin: 2px 4px 2px 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<a-select v-model:value="form.type" placeholder="请选择类型">
|
||||
<a-select-option :value="0">经销商</a-select-option>
|
||||
<a-select-option :value="1">门店</a-select-option>
|
||||
<!-- <a-select-option :value="2">集团</a-select-option>-->
|
||||
<!-- <a-select-option :value="2">集团</a-select-option>-->
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -65,20 +65,20 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="12">-->
|
||||
<!-- <a-form-item-->
|
||||
<!-- label="支付密码"-->
|
||||
<!-- name="payPassword"-->
|
||||
<!-- :help="isUpdate ? '留空表示不修改' : undefined"-->
|
||||
<!-- >-->
|
||||
<!-- <a-input-password-->
|
||||
<!-- allow-clear-->
|
||||
<!-- :maxlength="20"-->
|
||||
<!-- placeholder="请输入支付密码"-->
|
||||
<!-- v-model:value="form.payPassword"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :span="12">-->
|
||||
<!-- <a-form-item-->
|
||||
<!-- label="支付密码"-->
|
||||
<!-- name="payPassword"-->
|
||||
<!-- :help="isUpdate ? '留空表示不修改' : undefined"-->
|
||||
<!-- >-->
|
||||
<!-- <a-input-password-->
|
||||
<!-- allow-clear-->
|
||||
<!-- :maxlength="20"-->
|
||||
<!-- placeholder="请输入支付密码"-->
|
||||
<!-- v-model:value="form.payPassword"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<a-col :span="12">
|
||||
<a-form-item label="头像" name="image">
|
||||
<a-image :src="form.avatar" :width="50" :preview="false" />
|
||||
@@ -144,44 +144,44 @@
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <a-col :span="12">-->
|
||||
<!-- <a-form-item label="单价" name="price">-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- class="ele-fluid"-->
|
||||
<!-- :min="0"-->
|
||||
<!-- :precision="2"-->
|
||||
<!-- stringMode-->
|
||||
<!-- placeholder="0.00"-->
|
||||
<!-- v-model:value="form.price"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :span="12">-->
|
||||
<!-- <a-form-item label="单价" name="price">-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- class="ele-fluid"-->
|
||||
<!-- :min="0"-->
|
||||
<!-- :precision="2"-->
|
||||
<!-- stringMode-->
|
||||
<!-- placeholder="0.00"-->
|
||||
<!-- v-model:value="form.price"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
</a-row>
|
||||
|
||||
<!-- <a-row :gutter="16">-->
|
||||
<!-- <a-col :span="12">-->
|
||||
<!-- <a-form-item label="排序号" name="sortNumber">-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :min="0"-->
|
||||
<!-- :max="9999"-->
|
||||
<!-- class="ele-fluid"-->
|
||||
<!-- placeholder="请输入排序号"-->
|
||||
<!-- v-model:value="form.sortNumber"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :span="12">-->
|
||||
<!-- <a-form-item label="备注" name="comments">-->
|
||||
<!-- <a-textarea-->
|
||||
<!-- :rows="3"-->
|
||||
<!-- :maxlength="200"-->
|
||||
<!-- show-count-->
|
||||
<!-- placeholder="请输入备注"-->
|
||||
<!-- v-model:value="form.comments"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- </a-row>-->
|
||||
<!-- <a-row :gutter="16">-->
|
||||
<!-- <a-col :span="12">-->
|
||||
<!-- <a-form-item label="排序号" name="sortNumber">-->
|
||||
<!-- <a-input-number-->
|
||||
<!-- :min="0"-->
|
||||
<!-- :max="9999"-->
|
||||
<!-- class="ele-fluid"-->
|
||||
<!-- placeholder="请输入排序号"-->
|
||||
<!-- v-model:value="form.sortNumber"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- <a-col :span="12">-->
|
||||
<!-- <a-form-item label="备注" name="comments">-->
|
||||
<!-- <a-textarea-->
|
||||
<!-- :rows="3"-->
|
||||
<!-- :maxlength="200"-->
|
||||
<!-- show-count-->
|
||||
<!-- placeholder="请输入备注"-->
|
||||
<!-- v-model:value="form.comments"-->
|
||||
<!-- />-->
|
||||
<!-- </a-form-item>-->
|
||||
<!-- </a-col>-->
|
||||
<!-- </a-row>-->
|
||||
</a-form>
|
||||
</ele-modal>
|
||||
</template>
|
||||
@@ -190,7 +190,10 @@
|
||||
import { computed, ref, reactive, watch } from 'vue';
|
||||
import { Form, message } from 'ant-design-vue';
|
||||
import { assignObject, toDateString, uuid } from 'ele-admin-pro';
|
||||
import { addShopDealerUser, updateShopDealerUser } from '@/api/shop/shopDealerUser';
|
||||
import {
|
||||
addShopDealerUser,
|
||||
updateShopDealerUser
|
||||
} from '@/api/shop/shopDealerUser';
|
||||
import { ShopDealerUser } from '@/api/shop/shopDealerUser/model';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import { storeToRefs } from 'pinia';
|
||||
@@ -260,11 +263,15 @@
|
||||
};
|
||||
|
||||
const createTimeText = computed(() => {
|
||||
return form.createTime ? toDateString(form.createTime, 'yyyy-MM-dd HH:mm:ss') : '';
|
||||
return form.createTime
|
||||
? toDateString(form.createTime, 'yyyy-MM-dd HH:mm:ss')
|
||||
: '';
|
||||
});
|
||||
|
||||
const updateTimeText = computed(() => {
|
||||
return form.updateTime ? toDateString(form.updateTime, 'yyyy-MM-dd HH:mm:ss') : '';
|
||||
return form.updateTime
|
||||
? toDateString(form.updateTime, 'yyyy-MM-dd HH:mm:ss')
|
||||
: '';
|
||||
});
|
||||
|
||||
const selectedUserText = ref<string>('');
|
||||
@@ -369,13 +376,7 @@
|
||||
.then(() => {
|
||||
loading.value = true;
|
||||
// 不在弹窗里编辑的字段不提交,避免误更新(如自增ID、删除标识等)
|
||||
const {
|
||||
isDelete,
|
||||
tenantId,
|
||||
createTime,
|
||||
updateTime,
|
||||
...rest
|
||||
} = form;
|
||||
const { isDelete, tenantId, createTime, updateTime, ...rest } = form;
|
||||
const formData: ShopDealerUser = { ...rest };
|
||||
// userId 新增需要,编辑不允许修改
|
||||
if (isUpdate.value) {
|
||||
@@ -385,7 +386,9 @@
|
||||
if (isUpdate.value && !formData.payPassword) {
|
||||
delete formData.payPassword;
|
||||
}
|
||||
const saveOrUpdate = isUpdate.value ? updateShopDealerUser : addShopDealerUser;
|
||||
const saveOrUpdate = isUpdate.value
|
||||
? updateShopDealerUser
|
||||
: addShopDealerUser;
|
||||
saveOrUpdate(formData)
|
||||
.then((msg) => {
|
||||
loading.value = false;
|
||||
@@ -412,12 +415,12 @@
|
||||
// 不回显密码,避免误操作
|
||||
form.payPassword = '';
|
||||
selectedUserText.value = '';
|
||||
if(props.data.image){
|
||||
if (props.data.image) {
|
||||
images.value.push({
|
||||
uid: uuid(),
|
||||
url: props.data.image,
|
||||
status: 'done'
|
||||
})
|
||||
});
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
|
||||
@@ -26,10 +26,13 @@
|
||||
<template v-if="column.key === 'type'">
|
||||
<a-tag v-if="record.type === 0">经销商</a-tag>
|
||||
<a-tag v-if="record.type === 1" color="orange">门店</a-tag>
|
||||
<!-- <a-tag v-if="record.type === 2" color="purple">集团</a-tag>-->
|
||||
<!-- <a-tag v-if="record.type === 2" color="purple">集团</a-tag>-->
|
||||
</template>
|
||||
<template v-if="column.key === 'qrcode'">
|
||||
<QrcodeOutlined :style="{fontSize: '24px'}" @click="openQrCode(record)" />
|
||||
<QrcodeOutlined
|
||||
:style="{ fontSize: '24px' }"
|
||||
@click="openQrCode(record)"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<a-tag v-if="record.status === 0" color="green">显示</a-tag>
|
||||
@@ -52,7 +55,11 @@
|
||||
</a-card>
|
||||
|
||||
<!-- 编辑弹窗 -->
|
||||
<ShopDealerUserEdit v-model:visible="showEdit" :data="current" @done="reload" />
|
||||
<ShopDealerUserEdit
|
||||
v-model:visible="showEdit"
|
||||
:data="current"
|
||||
@done="reload"
|
||||
/>
|
||||
|
||||
<!-- 二维码预览 -->
|
||||
<a-modal
|
||||
@@ -64,7 +71,12 @@
|
||||
destroy-on-close
|
||||
>
|
||||
<div style="display: flex; justify-content: center">
|
||||
<a-image v-if="qrModalUrl" :src="qrModalUrl" :width="280" :preview="false" />
|
||||
<a-image
|
||||
v-if="qrModalUrl"
|
||||
:src="qrModalUrl"
|
||||
:width="280"
|
||||
:preview="false"
|
||||
/>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: center; margin-top: 12px">
|
||||
<a-space>
|
||||
@@ -79,7 +91,10 @@
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, computed } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined, QrcodeOutlined } from '@ant-design/icons-vue';
|
||||
import {
|
||||
ExclamationCircleOutlined,
|
||||
QrcodeOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
import { toDateString } from 'ele-admin-pro';
|
||||
import type {
|
||||
@@ -87,10 +102,17 @@
|
||||
ColumnItem
|
||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||
import Search from './components/search.vue';
|
||||
import {getPageTitle} from '@/utils/common';
|
||||
import { getPageTitle } from '@/utils/common';
|
||||
import ShopDealerUserEdit from './components/shopDealerUserEdit.vue';
|
||||
import { pageShopDealerUser, removeShopDealerUser, removeBatchShopDealerUser } from '@/api/shop/shopDealerUser';
|
||||
import type { ShopDealerUser, ShopDealerUserParam } from '@/api/shop/shopDealerUser/model';
|
||||
import {
|
||||
pageShopDealerUser,
|
||||
removeShopDealerUser,
|
||||
removeBatchShopDealerUser
|
||||
} from '@/api/shop/shopDealerUser';
|
||||
import type {
|
||||
ShopDealerUser,
|
||||
ShopDealerUserParam
|
||||
} from '@/api/shop/shopDealerUser/model';
|
||||
|
||||
// 表格实例
|
||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||
@@ -111,7 +133,9 @@
|
||||
const loading = ref(true);
|
||||
|
||||
const getQrCodeUrl = (userId?: number) => {
|
||||
return `https://mp-api.websoft.top/api/wx-login/getOrderQRCodeUnlimited/uid_${userId ?? ''}`;
|
||||
return `https://mp-api.websoft.top/api/wx-login/getOrderQRCodeUnlimited/uid_${
|
||||
userId ?? ''
|
||||
}`;
|
||||
};
|
||||
|
||||
const openQrCode = (row: ShopDealerUser) => {
|
||||
@@ -120,7 +144,9 @@
|
||||
return;
|
||||
}
|
||||
qrModalUrl.value = getQrCodeUrl(row.userId);
|
||||
qrModalTitle.value = row.realName ? `${row.realName} 的二维码` : `UID_${row.userId} 二维码`;
|
||||
qrModalTitle.value = row.realName
|
||||
? `${row.realName} 的二维码`
|
||||
: `UID_${row.userId} 二维码`;
|
||||
showQrModal.value = true;
|
||||
};
|
||||
|
||||
@@ -168,7 +194,7 @@
|
||||
title: '用户ID',
|
||||
dataIndex: 'userId',
|
||||
key: 'userId',
|
||||
width: 90,
|
||||
width: 90
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
:body-style="{ paddingTop: '0px', minHeight: '800px' }"
|
||||
>
|
||||
<a-tabs v-model:active-key="active">
|
||||
<!-- <a-tab-pane tab="网站设置" key="website">-->
|
||||
<!-- <Website v-model:value="active" :data="data" />-->
|
||||
<!-- </a-tab-pane>-->
|
||||
<!-- <a-tab-pane tab="网站设置" key="website">-->
|
||||
<!-- <Website v-model:value="active" :data="data" />-->
|
||||
<!-- </a-tab-pane>-->
|
||||
<a-tab-pane tab="上传设置" key="upload">
|
||||
<Upload v-model:value="active" :data="data" />
|
||||
</a-tab-pane>
|
||||
|
||||
@@ -101,7 +101,7 @@ export default defineConfig(({ command, mode }) => {
|
||||
// GET /ai-proxy/models -> https://ai.websoft.top/api/v1/models
|
||||
// POST /ai-proxy/chat/completions -> https://ai.websoft.top/api/v1/chat/completions
|
||||
'/ai-proxy': {
|
||||
target: env.AI_PROXY_TARGET || 'https://ai-api.websoft.top',
|
||||
target: env.AI_PROXY_TARGET || 'http://127.0.0.1:11434',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
rewrite: (path) =>
|
||||
@@ -124,10 +124,10 @@ export default defineConfig(({ command, mode }) => {
|
||||
}
|
||||
},
|
||||
// Ollama native API reverse proxy (dev only).
|
||||
// GET /proxy/api/tags -> http://47.119.165.234:11434/api/tags
|
||||
// POST /proxy/api/chat -> http://47.119.165.234:11434/api/chat
|
||||
// GET /proxy/api/tags -> http://127.0.0.1:11434/api/tags
|
||||
// POST /proxy/api/chat -> http://127.0.0.1:11434/api/chat
|
||||
'/proxy': {
|
||||
target: 'http://47.119.165.234:11434',
|
||||
target: 'http://127.0.0.1:11434',
|
||||
changeOrigin: true,
|
||||
secure: false,
|
||||
rewrite: (path) => path.replace(/^\/proxy/, '')
|
||||
|
||||
Reference in New Issue
Block a user