Преглед на файлове

```
fix(env): 注释测试环境配置中的无效服务地址

- 注释掉邓的cpolar测试地址
- 启用服务器地址配置

feat(user): 用户管理模块增加业务类型权限字段

- 引入字典数据获取接口
- 添加业务类型权限下拉选择组件
- 调整企业权限标签文案为"企业权限"
- 移除邮箱必填验证

fix(activity): 修复活动管理相关验证问题

- 将活动有效期最大值从100调整为10000
- 修正折扣金额验证逻辑,将小于改为小于等于
- 更新验证错误提示文案

refactor(goods): 商品价格提交逻辑临时注释

- 临时注释价格数据为空的验证逻辑
- 移除调试用的console.log

refactor(order): 订单导出功能重构为下拉菜单形式

- 移除权限验证hook引入
- 实现导出商品数据和订单数据的下拉菜单选项
- 优化导出按钮布局和交互方式
- 添加订单详情积分抵扣注释说明

style(order): 订单详情表格样式微调

- 在订单详情中添加积分抵扣计算的注释说明
```

wenjie преди 2 дни
родител
ревизия
678a178625

+ 2 - 2
.env.test

@@ -3,14 +3,14 @@
 # VITE_SERVICE_BASE_URL=https://b8dbdde.r39.cpolar.top #王
 # VITE_SERVICE_BASE_URL=http://89561bkaq794.vicp.fun:53846 #张
 # VITE_SERVICE_BASE_URL=http://192.168.1.89:8080#田
-VITE_SERVICE_BASE_URL=https://425f86e6.r24.cpolar.top #邓
+# VITE_SERVICE_BASE_URL=https://425f86e6.r24.cpolar.top #邓
 # VITE_SERVICE_BASE_URL=http://74949mkfh190.vicp.fun #付
 # VITE_SERVICE_BASE_URL=https://smqjh.api.zswlgz.com
 # VITE_SERVICE_BASE_URL=https://735a1bda.r24.cpolar.top #黄
 # VITE_SERVICE_BASE_URL=http://89561bkaq794.vicp.fun:53846
 
 # VITE_SERVICE_BASE_URL=http://47.109.84.152:8081#打包测试本地服务器
-# VITE_SERVICE_BASE_URL=https://smqjh.api.zswlgz.com #服务器
+VITE_SERVICE_BASE_URL=https://smqjh.api.zswlgz.com #服务器
 
 # other backend service base url, test environment
 VITE_OTHER_SERVICE_BASE_URL= `{

+ 4 - 5
src/views/goods-center/store-goods/index.vue

@@ -642,10 +642,10 @@ function handleDelPrice(index: number) {
 }
 
 async function handleSubmitPrice() {
-  if (!PriceData.value.length) {
-    window.$message?.error('最少填写一条数据');
-    return;
-  }
+  // if (!PriceData.value.length) {
+  //   window.$message?.error('最少填写一条数据');
+  //   return;
+  // }
   if (!areAllItemsAllFieldsFilled(PriceData.value)) {
     window.$message?.error('请填写完整数据');
     return;
@@ -675,7 +675,6 @@ async function handleSubmitPrice() {
   } else {
     setSubModalLoding(false);
   }
-  console.log(PriceData.value, 'asdsad');
 }
 async function getData() {
   const { data, error } = await fetchGetChannelList();

+ 3 - 3
src/views/jy-manage/activity/index.vue

@@ -234,7 +234,7 @@ const [
         render: ({ model, field }) => {
           return (
             <div class="flex items-center">
-              领取后 <n-input-number v-model:value={model[field]} min={0} max={100} clearable /> 天有效
+              领取后 <n-input-number v-model:value={model[field]} min={0} max={10000} clearable /> 天有效
             </div>
           );
         }
@@ -388,10 +388,10 @@ async function validatePrice(_: any, value: any) {
 }
 async function validateDiscountMoney(_: any, value: any) {
   const form = await getModalFormValue();
-  if (value < form.amountMoney * 0.5) {
+  if (value <= form.amountMoney * 0.5) {
     return; // 验证通过时返回undefined
   }
-  throw new Error('需要小于门槛金额*0.5.数值范围0-1000,保留两位小数'); // 验证失败时抛出错误
+  throw new Error('需要小于等于门槛金额*0.5.数值范围0-1000,保留两位小数'); // 验证失败时抛出错误
 }
 
 async function edit(row: Api.goods.ShopCategory) {

+ 36 - 18
src/views/manage/user/index.vue

@@ -10,6 +10,7 @@ import {
   fetchGetUserList
 } from '@/service/api';
 import { fetchGetChannelList } from '@/service/api/goods-center/store-goods';
+import { fetchGetDictDataList } from '@/service/api/system-manage';
 import { fetchGetDepartmentList } from '@/service/api/system-department';
 import imgs from '@/assets/imgs/logo.png';
 import { useTable } from '@/components/zt/Table/hooks/useTable';
@@ -43,21 +44,21 @@ const columns: NaiveUI.TableColumn<Api.SystemManage.userList>[] = [
     align: 'center',
     minWidth: 100
   },
-  {
-    key: 'nickname',
-    title: $t('page.manage.user.nickName'),
-    align: 'center',
-    minWidth: 100
-  },
-  {
-    key: 'deptName',
-    title: '所属部门',
-    align: 'center',
-    width: 220,
-    ellipsis: {
-      tooltip: true
-    }
-  },
+  // {
+  //   key: 'nickname',
+  //   title: $t('page.manage.user.nickName'),
+  //   align: 'center',
+  //   minWidth: 100
+  // },
+  // {
+  //   key: 'deptName',
+  //   title: '所属部门',
+  //   align: 'center',
+  //   width: 220,
+  //   ellipsis: {
+  //     tooltip: true
+  //   }
+  // },
 
   {
     key: 'mobile',
@@ -153,7 +154,7 @@ const [registerModalForm, { openModal, closeModal, getFieldsValue, setFieldsValu
         },
         {
           field: 'channelIdList',
-          label: '所属企业',
+          label: '企业权限',
           component: 'ApiSelect',
           required: true,
           componentProps: {
@@ -163,6 +164,23 @@ const [registerModalForm, { openModal, closeModal, getFieldsValue, setFieldsValu
             multiple: true
           }
         },
+        {
+          field: 'businessTypeList',
+          label: '业务类型权限',
+          component: 'ApiSelect',
+          required: true,
+          componentProps: {
+            api: fetchGetDictDataList,
+            labelFeild: 'name',
+            valueFeild: 'value',
+            multiple: true,
+            resultFeild: 'data.list',
+            params: {
+              typeCode: 'sys_business_type'
+            }
+          }
+        },
+
         {
           field: 'deptId',
           label: '归属部门',
@@ -180,7 +198,6 @@ const [registerModalForm, { openModal, closeModal, getFieldsValue, setFieldsValu
           field: 'email',
           label: '邮箱',
           component: 'NInput',
-          required: true,
           rules: [
             {
               type: 'email',
@@ -188,7 +205,8 @@ const [registerModalForm, { openModal, closeModal, getFieldsValue, setFieldsValu
               trigger: ['blur', 'input', 'change'],
               validator: (_fomItem, value, callback) => {
                 if (!value) {
-                  callback(new Error('请输入邮箱'));
+                  // callback(new Error('请输入邮箱'));
+                  return true;
                 } else if (!/^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(value)) {
                   callback(new Error('请输入正确的邮箱'));
                 }

+ 42 - 25
src/views/order-manage/normal-order/index.vue

@@ -12,7 +12,7 @@ import {
   fetchGetDeliveryStatusNum
 } from '@/service/api/order-manage/normal-order';
 // import { fetchGetLoginUserList } from '@/service/api/common';
-import { useAuth } from '@/hooks/business/auth';
+// import { useAuth } from '@/hooks/business/auth';
 // import { copyTextToClipboard } from '@/utils/zt';
 import { commonExport } from '@/utils/common';
 import { useModal } from '@/components/zt/Modal/hooks/useModal';
@@ -26,6 +26,16 @@ const statusList = ref<{ label: string; value: string; num?: number }[]>([]);
 // const ShipmentModal = useTemplateRef('Shipment');
 const channelIdList = ref([]);
 const orderNumber = route.query.orderNumber;
+const options = [
+  {
+    label: '导出商品数据',
+    key: 'goods'
+  },
+  {
+    label: '导出订单数据',
+    key: 'order'
+  }
+];
 const columns: NaiveUI.TableColumn<Api.delivery.deliveryOrder>[] = [
   {
     key: 'orderNumber',
@@ -347,6 +357,20 @@ onMounted(async () => {
   await setFieldsValue({ orderNumber });
   refresh();
 });
+
+function getData() {
+  return getTableData() || [];
+}
+
+function handleSelect(key: string) {
+  console.log(key);
+
+  if (key === 'goods') {
+    handleExport();
+  } else if (key === 'order') {
+    handleExportLog();
+  }
+}
 </script>
 
 <template>
@@ -393,30 +417,23 @@ onMounted(async () => {
       </template>
       <template #prefix="{ loading }">
         <div class="flex items-center">
-          <NButton
-            v-if="useAuth().hasAuth('order:user:export')"
-            size="small"
-            type="primary"
-            class="ml20px mt30px"
-            ghost
-            :loading="loading"
-            :disabled="getTableData().length == 0"
-            @click="handleExport"
-          >
-            <template #icon>
-              <SvgIcon icon="mingcute:file-export-line"></SvgIcon>
-            </template>
-            导出
-          </NButton>
-          <NButton
-            v-if="useAuth().hasAuth('order:user:export')"
-            size="small"
-            type="primary"
-            class="ml20px mt30px"
-            ghost
-            :loading="loading"
-            @click="handleExportLog"
-          >
+          <NDropdown trigger="hover" :options="options" @select="handleSelect">
+            <NButton
+              size="small"
+              type="primary"
+              ghost
+              :loading="loading"
+              :disabled="getData().length === 0"
+              @click="handleExport"
+            >
+              <template #icon>
+                <SvgIcon icon="mingcute:file-export-line"></SvgIcon>
+              </template>
+              导出
+            </NButton>
+          </NDropdown>
+
+          <NButton size="small" type="primary" class="ml10px" ghost :loading="loading" @click="handleExportLog">
             导出记录
           </NButton>
         </div>

+ 1 - 0
src/views/order-manage/order-detail/index.vue

@@ -324,6 +324,7 @@ function secondsToTime(seconds: number) {
                   <NTr>
                     <NTd>积分抵扣</NTd>
                     <NTd>{{ orderInfo.actualTotal }}</NTd>
+                    <!-- <NTd>{{ orderInfo.actualTotal - orderInfo.platformVolume }}</NTd> -->
                   </NTr>
                 </NTbody>
               </NTable>