Selaa lähdekoodia

新增 备货属性 企业规模 等

hurx 2 viikkoa sitten
vanhempi
sitoutus
d838454edc

+ 63 - 0
src/api/customer/customerTag/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { CustomerTagVO, CustomerTagForm, CustomerTagQuery } from '@/api/customer/customerTag/types';
+
+/**
+ * 查询客户标签列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listCustomerTag = (query?: CustomerTagQuery): AxiosPromise<CustomerTagVO[]> => {
+  return request({
+    url: '/customer/customerTag/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询客户标签详细
+ * @param id
+ */
+export const getCustomerTag = (id: string | number): AxiosPromise<CustomerTagVO> => {
+  return request({
+    url: '/customer/customerTag/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增客户标签
+ * @param data
+ */
+export const addCustomerTag = (data: CustomerTagForm) => {
+  return request({
+    url: '/customer/customerTag',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改客户标签
+ * @param data
+ */
+export const updateCustomerTag = (data: CustomerTagForm) => {
+  return request({
+    url: '/customer/customerTag',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除客户标签
+ * @param id
+ */
+export const delCustomerTag = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/customer/customerTag/' + id,
+    method: 'delete'
+  });
+};

+ 80 - 0
src/api/customer/customerTag/types.ts

@@ -0,0 +1,80 @@
+export interface CustomerTagVO {
+  /**
+   * ID
+   */
+  id: string | number;
+
+  /**
+   * 标签名称
+   */
+  tagName: string;
+
+  /**
+   * 商品标签
+   */
+  productTagIds: string;
+
+  /**
+   * 状态(0启用 1禁用)
+   */
+  status: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+}
+
+export interface CustomerTagForm extends BaseEntity {
+  /**
+   * ID
+   */
+  id?: string | number;
+
+  /**
+   * 标签名称
+   */
+  tagName?: string;
+
+  /**
+   * 商品标签
+   */
+  productTagIds?: string;
+
+  /**
+   * 状态(0启用 1禁用)
+   */
+  status?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+}
+
+export interface CustomerTagQuery extends PageQuery {
+  /**
+   * 标签名称
+   */
+  tagName?: string;
+
+  /**
+   * 商品标签
+   */
+  productTagIds?: string;
+
+  /**
+   * 状态(0启用 1禁用)
+   */
+  status?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 63 - 0
src/api/customer/enterpriseScale/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { EnterpriseScaleVO, EnterpriseScaleForm, EnterpriseScaleQuery } from '@/api/customer/enterpriseScale/types';
+
+/**
+ * 查询企业规模列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listEnterpriseScale = (query?: EnterpriseScaleQuery): AxiosPromise<EnterpriseScaleVO[]> => {
+  return request({
+    url: '/customer/enterpriseScale/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询企业规模详细
+ * @param id
+ */
+export const getEnterpriseScale = (id: string | number): AxiosPromise<EnterpriseScaleVO> => {
+  return request({
+    url: '/customer/enterpriseScale/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增企业规模
+ * @param data
+ */
+export const addEnterpriseScale = (data: EnterpriseScaleForm) => {
+  return request({
+    url: '/customer/enterpriseScale',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改企业规模
+ * @param data
+ */
+export const updateEnterpriseScale = (data: EnterpriseScaleForm) => {
+  return request({
+    url: '/customer/enterpriseScale',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除企业规模
+ * @param id
+ */
+export const delEnterpriseScale = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/customer/enterpriseScale/' + id,
+    method: 'delete'
+  });
+};

+ 79 - 0
src/api/customer/enterpriseScale/types.ts

@@ -0,0 +1,79 @@
+export interface EnterpriseScaleVO {
+  /**
+   * ID
+   */
+  id: string | number;
+
+  enterpriseScaleCode: string;
+
+  /**
+   * 企业规模名称
+   */
+  enterpriseScaleName: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode: string;
+}
+
+export interface EnterpriseScaleForm extends BaseEntity {
+  /**
+   * ID
+   */
+  id?: string | number;
+
+  enterpriseScaleCode?: string;
+
+  /**
+   * 企业规模名称
+   */
+  enterpriseScaleName?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+}
+
+export interface EnterpriseScaleQuery extends PageQuery {
+  /**
+   * 企业规模名称
+   */
+  enterpriseScaleName?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 63 - 0
src/api/customer/industryCategory/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { IndustryCategoryVO, IndustryCategoryForm, IndustryCategoryQuery } from '@/api/customer/industryCategory/types';
+
+/**
+ * 查询所属行业列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listIndustryCategory = (query?: IndustryCategoryQuery): AxiosPromise<IndustryCategoryVO[]> => {
+  return request({
+    url: '/customer/industryCategory/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询所属行业详细
+ * @param id
+ */
+export const getIndustryCategory = (id: string | number): AxiosPromise<IndustryCategoryVO> => {
+  return request({
+    url: '/customer/industryCategory/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增所属行业
+ * @param data
+ */
+export const addIndustryCategory = (data: IndustryCategoryForm) => {
+  return request({
+    url: '/customer/industryCategory',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改所属行业
+ * @param data
+ */
+export const updateIndustryCategory = (data: IndustryCategoryForm) => {
+  return request({
+    url: '/customer/industryCategory',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除所属行业
+ * @param id
+ */
+export const delIndustryCategory = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/customer/industryCategory/' + id,
+    method: 'delete'
+  });
+};

+ 79 - 0
src/api/customer/industryCategory/types.ts

@@ -0,0 +1,79 @@
+export interface IndustryCategoryVO {
+  /**
+   * ID
+   */
+  id: string | number;
+
+  industryCode: string;
+
+  /**
+   * 所属行业
+   */
+  industryCategoryName: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode: string;
+}
+
+export interface IndustryCategoryForm extends BaseEntity {
+  /**
+   * ID
+   */
+  id?: string | number;
+
+  industryCode?: string;
+
+  /**
+   * 所属行业
+   */
+  industryCategoryName?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+}
+
+export interface IndustryCategoryQuery extends PageQuery {
+  /**
+   * 所属行业
+   */
+  industryCategoryName?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 0 - 3
src/api/customer/supplierInfo/index.ts

@@ -62,7 +62,6 @@ export const delInfo = (id: string | number | Array<string | number>) => {
   });
 };
 
-
 /**
  * 获取供应商类型列表
  */
@@ -286,8 +285,6 @@ export const getSupplierTypeList = (params?: any) => {
     url: '/system/type/list',
     method: 'get',
     params: {
-
-
       dataSource: 'youyi',
       ...params
     }

+ 63 - 0
src/api/customer/tagCategory/index.ts

@@ -0,0 +1,63 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { TagCategoryVO, TagCategoryForm, TagCategoryQuery } from '@/api/customer/tagCategory/types';
+
+/**
+ * 查询标签类别信息列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listTagCategory = (query?: TagCategoryQuery): AxiosPromise<TagCategoryVO[]> => {
+  return request({
+    url: '/customer/tagCategory/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询标签类别信息详细
+ * @param id
+ */
+export const getTagCategory = (id: string | number): AxiosPromise<TagCategoryVO> => {
+  return request({
+    url: '/customer/tagCategory/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增标签类别信息
+ * @param data
+ */
+export const addTagCategory = (data: TagCategoryForm) => {
+  return request({
+    url: '/customer/tagCategory',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改标签类别信息
+ * @param data
+ */
+export const updateTagCategory = (data: TagCategoryForm) => {
+  return request({
+    url: '/customer/tagCategory',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除标签类别信息
+ * @param id
+ */
+export const delTagCategory = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/customer/tagCategory/' + id,
+    method: 'delete'
+  });
+};

+ 75 - 0
src/api/customer/tagCategory/types.ts

@@ -0,0 +1,75 @@
+export interface TagCategoryVO {
+  /**
+   * ID
+   */
+  id: string | number;
+
+  /**
+   * 标签分类
+   */
+  tagCategoryName: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode: string;
+}
+
+export interface TagCategoryForm extends BaseEntity {
+  /**
+   * ID
+   */
+  id?: string | number;
+
+  /**
+   * 标签分类
+   */
+  tagCategoryName?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+}
+
+export interface TagCategoryQuery extends PageQuery {
+  /**
+   * 标签分类
+   */
+  tagCategoryName?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+  /**
+   * 日期范围参数
+   */
+  params?: any;
+}

+ 75 - 0
src/api/product/stockUp/index.ts

@@ -0,0 +1,75 @@
+import request from '@/utils/request';
+import { AxiosPromise } from 'axios';
+import { StockUpVO, StockUpForm, StockUpQuery } from '@/api/product/stockUp/types';
+
+/**
+ * 查询商品备货属性列表
+ * @param query
+ * @returns {*}
+ */
+
+export const listStockUp = (query?: StockUpQuery): AxiosPromise<StockUpVO[]> => {
+  return request({
+    url: '/system/stockUp/list',
+    method: 'get',
+    params: query
+  });
+};
+
+/**
+ * 查询商品备货属性详细
+ * @param id
+ */
+export const getStockUp = (id: string | number): AxiosPromise<StockUpVO> => {
+  return request({
+    url: '/system/stockUp/' + id,
+    method: 'get'
+  });
+};
+
+/**
+ * 新增商品备货属性
+ * @param data
+ */
+export const addStockUp = (data: StockUpForm) => {
+  return request({
+    url: '/system/stockUp',
+    method: 'post',
+    data: data
+  });
+};
+
+/**
+ * 修改商品备货属性
+ * @param data
+ */
+export const updateStockUp = (data: StockUpForm) => {
+  return request({
+    url: '/system/stockUp',
+    method: 'put',
+    data: data
+  });
+};
+
+/**
+ * 删除商品备货属性
+ * @param id
+ */
+export const delStockUp = (id: string | number | Array<string | number>) => {
+  return request({
+    url: '/system/stockUp/' + id,
+    method: 'delete'
+  });
+};
+
+export function changeStatus(id: string | number, isShow: string) {
+  const data = {
+    id,
+    isShow
+  };
+  return request({
+    url: '/system/stockUp/changeStatus',
+    method: 'put',
+    data: data
+  });
+}

+ 116 - 0
src/api/product/stockUp/types.ts

@@ -0,0 +1,116 @@
+export interface StockUpVO {
+  /**
+   * 主键ID
+   */
+  id: string | number;
+
+  /**
+   * 属性编号
+   */
+  stockNo: string;
+
+  /**
+   * 属性名称
+   */
+  stockName: string;
+
+  /**
+   * 是否显示(0-显示,1-不显示)
+   */
+  isShow: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status: string;
+
+  /**
+   * 备注
+   */
+  remark: string;
+
+}
+
+export interface StockUpForm extends BaseEntity {
+  /**
+   * 主键ID
+   */
+  id?: string | number;
+
+  /**
+   * 属性编号
+   */
+  stockNo?: string;
+
+  /**
+   * 属性名称
+   */
+  stockName?: string;
+
+  /**
+   * 是否显示(0-显示,1-不显示)
+   */
+  isShow?: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 备注
+   */
+  remark?: string;
+
+}
+
+export interface StockUpQuery extends PageQuery {
+
+  /**
+   * 属性编号
+   */
+  stockNo?: string;
+
+  /**
+   * 属性名称
+   */
+  stockName?: string;
+
+  /**
+   * 是否显示(0-显示,1-不显示)
+   */
+  isShow?: string;
+
+  /**
+   * 数据来源
+   */
+  dataSource?: string;
+
+  /**
+   * 状态(0正常 1停用)
+   */
+  status?: string;
+
+  /**
+   * 平台标识
+   */
+  platformCode?: string;
+
+    /**
+     * 日期范围参数
+     */
+    params?: any;
+}
+
+
+

+ 1 - 1
src/views/company/company/index.vue

@@ -30,7 +30,7 @@
       <el-table v-loading="loading" border :data="companyList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
         <el-table-column label="企业编号" align="center" prop="companyCode" />
-        <el-table-column label="企业名称" align="center" prop="companyName" />
+        <el-table-column label="企业名称" align="left" prop="companyName" min-width="180" />
         <el-table-column label="成立日期" align="center" prop="foundDate" width="180">
           <template #default="scope">
             <span>{{ parseTime(scope.row.foundDate, '{y}-{m}-{d}') }}</span>

+ 325 - 0
src/views/customer/customerTag/index.vue

@@ -0,0 +1,325 @@
+<template>
+  <div class="p-2">
+    <el-card shadow="never">
+      <template #header>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="21">
+            <span>标签类别信息列表</span>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['customer:customerTag:add']">新增</el-button>
+          </el-col>
+        </el-row>
+      </template>
+
+      <el-table v-loading="loading" border :data="customerTagList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="标签名称" align="center" prop="tagName" />
+        <el-table-column label="匹配商品标签" align="center" prop="productTagIds">
+          <template #default="scope">
+            <span v-if="scope.row.productTagIds">
+              {{ formatProductTags(scope.row.productTagIds) }}
+            </span>
+            <span v-else class="text-gray-400">-</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="状态" align="center" prop="status">
+          <template #default="scope">
+            <span>{{ scope.row.status == '0' ? '启用' : '不启用' }} </span>
+          </template>
+        </el-table-column>
+        <el-table-column label="备注" align="center" prop="remark" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template #default="scope">
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['customer:customerTag:edit']">编辑</el-button>
+            <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['customer:customerTag:remove']"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+    </el-card>
+    <!-- 添加或修改客户标签对话框 -->
+    <el-dialog :title="dialog.title" v-model="dialog.visible" width="600px" append-to-body>
+      <el-form ref="customerTagFormRef" :model="form" :rules="rules" label-width="120px">
+        <el-form-item label="标签名称" prop="tagName">
+          <el-input v-model="form.tagName" placeholder="请输入标签名称" />
+        </el-form-item>
+        <el-form-item label="关联产品标签" prop="productTagIds">
+          <div class="w-full">
+            <!-- 已选择的标签 -->
+            <div class="mb-2" v-if="selectedProductTags.length > 0">
+              <el-tag v-for="tagId in selectedProductTags" :key="tagId" closable @close="removeTag(tagId)" class="mr-2 mb-2" type="primary">
+                {{ getTagName(tagId) }}
+              </el-tag>
+            </div>
+            <!-- 搜索框 -->
+            <div class="flex gap-2 mb-2">
+              <el-input v-model="searchKeyword" placeholder="请输入关联名称" clearable />
+              <el-button type="primary" @click="handleSearch">搜索</el-button>
+            </div>
+            <div class="text-sm text-gray-500 mb-2">
+              已选择 <span class="text-red-500">{{ selectedProductTags.length }}</span> 条
+            </div>
+            <!-- 可选标签列表 -->
+            <div class="border rounded bg-gray-50" style="min-height: 200px; max-height: 300px; overflow-y: auto">
+              <!-- 表头 -->
+              <div class="bg-gray-100 px-4 py-3 border-b flex items-center">
+                <el-checkbox v-model="selectAll" @change="handleSelectAll" class="mr-3" />
+                <span class="font-medium">可选标签</span>
+              </div>
+              <!-- 内容区 -->
+              <div class="p-4">
+                <div class="text-center text-gray-400 py-4" v-if="filteredProductTags.length === 0">暂无数据</div>
+                <el-checkbox-group v-else v-model="selectedProductTags" @change="handleProductTagChange" class="flex flex-wrap gap-2">
+                  <el-checkbox v-for="tag in filteredProductTags" :key="tag.id" :value="tag.id">
+                    {{ tag.name }}
+                  </el-checkbox>
+                </el-checkbox-group>
+              </div>
+            </div>
+          </div>
+        </el-form-item>
+        <el-form-item label="是否启用" prop="status">
+          <el-radio-group v-model="form.status">
+            <el-radio v-for="dict in is_enabled" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="CustomerTag" lang="ts">
+import { listCustomerTag, getCustomerTag, delCustomerTag, addCustomerTag, updateCustomerTag } from '@/api/customer/customerTag';
+import { CustomerTagVO, CustomerTagQuery, CustomerTagForm } from '@/api/customer/customerTag/types';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { is_enabled } = toRefs<any>(proxy?.useDict('is_enabled'));
+
+const customerTagList = ref<CustomerTagVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+// 商品标签假数据
+const productTagList = ref([
+  { id: 1, name: '热销商品' },
+  { id: 2, name: '旅游首选' },
+  { id: 3, name: '物美价廉' },
+  { id: 4, name: '性价比高' },
+  { id: 5, name: '价格便宜' }
+]);
+
+const searchKeyword = ref('');
+const selectedProductTags = ref<number[]>([]);
+const selectAll = ref(false);
+const filteredProductTags = computed(() => {
+  if (!searchKeyword.value) {
+    return productTagList.value;
+  }
+  return productTagList.value.filter((tag) => tag.name.toLowerCase().includes(searchKeyword.value.toLowerCase()));
+});
+
+const queryFormRef = ref<ElFormInstance>();
+const customerTagFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: CustomerTagForm = {
+  id: undefined,
+  tagName: undefined,
+  productTagIds: undefined,
+  status: '0',
+  remark: undefined
+};
+const data = reactive<PageData<CustomerTagForm, CustomerTagQuery>>({
+  form: { ...initFormData },
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    tagName: undefined,
+    productTagIds: undefined,
+    status: undefined,
+    platformCode: undefined,
+    params: {}
+  },
+  rules: {
+    tagName: [{ required: true, message: '标签名称不能为空', trigger: 'blur' }]
+  }
+});
+
+const { queryParams, form, rules } = toRefs(data);
+
+/** 查询客户标签列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listCustomerTag(queryParams.value);
+  customerTagList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = { ...initFormData };
+  customerTagFormRef.value?.resetFields();
+  selectedProductTags.value = [];
+  searchKeyword.value = '';
+  selectAll.value = false;
+};
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+};
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+};
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: CustomerTagVO[]) => {
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+};
+
+/** 新增按钮操作 */
+const handleAdd = () => {
+  reset();
+  dialog.visible = true;
+  dialog.title = '添加客户标签';
+};
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: CustomerTagVO) => {
+  reset();
+  const _id = row?.id || ids.value[0];
+  const res = await getCustomerTag(_id);
+  Object.assign(form.value, res.data);
+  // 回显已选择的商品标签
+  if (res.data.productTagIds) {
+    selectedProductTags.value = res.data.productTagIds.split(',').map(Number);
+  }
+  dialog.visible = true;
+  dialog.title = '修改客户标签';
+};
+
+/** 搜索商品标签 */
+const handleSearch = () => {
+  // 搜索逻辑已通过 computed 实现
+};
+
+/** 商品标签选择变化 */
+const handleProductTagChange = (value: number[]) => {
+  form.value.productTagIds = value.join(',');
+  updateSelectAllState();
+};
+
+/** 根据标签ID获取标签名称 */
+const getTagName = (tagId: number) => {
+  const tag = productTagList.value.find((t) => t.id === tagId);
+  return tag ? tag.name : '';
+};
+
+/** 移除已选择的标签 */
+const removeTag = (tagId: number) => {
+  selectedProductTags.value = selectedProductTags.value.filter((id) => id !== tagId);
+  form.value.productTagIds = selectedProductTags.value.join(',');
+  updateSelectAllState();
+};
+
+/** 全选/取消全选 */
+const handleSelectAll = (checked: boolean) => {
+  if (checked) {
+    selectedProductTags.value = filteredProductTags.value.map((tag) => tag.id);
+  } else {
+    selectedProductTags.value = [];
+  }
+  form.value.productTagIds = selectedProductTags.value.join(',');
+};
+
+/** 更新全选状态 */
+const updateSelectAllState = () => {
+  selectAll.value = filteredProductTags.value.length > 0 && selectedProductTags.value.length === filteredProductTags.value.length;
+};
+
+/** 格式化商品标签显示(将ID转换为名称) */
+const formatProductTags = (productTagIds: string) => {
+  if (!productTagIds) return '-';
+  const ids = productTagIds.split(',').map(Number);
+  const names = ids
+    .map((id) => {
+      const tag = productTagList.value.find((t) => t.id === id);
+      return tag ? tag.name : '';
+    })
+    .filter((name) => name);
+  return names.join('、') || '-';
+};
+
+/** 提交按钮 */
+const submitForm = () => {
+  customerTagFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      if (form.value.id) {
+        await updateCustomerTag(form.value).finally(() => (buttonLoading.value = false));
+      } else {
+        await addCustomerTag(form.value).finally(() => (buttonLoading.value = false));
+      }
+      proxy?.$modal.msgSuccess('操作成功');
+      dialog.visible = false;
+      await getList();
+    }
+  });
+};
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: CustomerTagVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除客户标签编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
+  await delCustomerTag(_ids);
+  proxy?.$modal.msgSuccess('删除成功');
+  await getList();
+};
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download(
+    'customer/customerTag/export',
+    {
+      ...queryParams.value
+    },
+    `customerTag_${new Date().getTime()}.xlsx`
+  );
+};
+
+onMounted(() => {
+  getList();
+});
+</script>

+ 204 - 0
src/views/customer/enterpriseScale/index.vue

@@ -0,0 +1,204 @@
+<template>
+  <div class="p-2">
+    <el-card shadow="never">
+      <template #header>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="21">
+            <span>标签类别信息列表</span>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['customer:enterpriseScale:remove']"
+              >批量删除</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['customer:enterpriseScale:add']">新增</el-button>
+          </el-col>
+        </el-row>
+      </template>
+
+      <el-table v-loading="loading" border :data="enterpriseScaleList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="企业规模" align="center" prop="enterpriseScaleName" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template #default="scope">
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['customer:enterpriseScale:edit']"
+              >编辑</el-button
+            >
+            <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['customer:enterpriseScale:remove']"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+    </el-card>
+    <!-- 添加或修改企业规模对话框 -->
+    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
+      <el-form ref="enterpriseScaleFormRef" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="企业规模" prop="enterpriseScaleName">
+          <el-input v-model="form.enterpriseScaleName" placeholder="请输入企业规模" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="EnterpriseScale" lang="ts">
+import {
+  listEnterpriseScale,
+  getEnterpriseScale,
+  delEnterpriseScale,
+  addEnterpriseScale,
+  updateEnterpriseScale
+} from '@/api/customer/enterpriseScale';
+import { EnterpriseScaleVO, EnterpriseScaleQuery, EnterpriseScaleForm } from '@/api/customer/enterpriseScale/types';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+const enterpriseScaleList = ref<EnterpriseScaleVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+const queryFormRef = ref<ElFormInstance>();
+const enterpriseScaleFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: EnterpriseScaleForm = {
+  id: undefined,
+  enterpriseScaleName: undefined,
+  status: undefined,
+  remark: undefined,
+  platformCode: undefined
+};
+const data = reactive<PageData<EnterpriseScaleForm, EnterpriseScaleQuery>>({
+  form: { ...initFormData },
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    enterpriseScaleName: undefined,
+    status: undefined,
+    platformCode: undefined,
+    params: {}
+  },
+  rules: {
+    enterpriseScaleName: [{ required: true, message: '企业规模不能为空', trigger: 'blur' }]
+  }
+});
+
+const { queryParams, form, rules } = toRefs(data);
+
+/** 查询企业规模列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listEnterpriseScale(queryParams.value);
+  enterpriseScaleList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = { ...initFormData };
+  enterpriseScaleFormRef.value?.resetFields();
+};
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+};
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+};
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: EnterpriseScaleVO[]) => {
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+};
+
+/** 新增按钮操作 */
+const handleAdd = () => {
+  reset();
+  dialog.visible = true;
+  dialog.title = '添加企业规模';
+};
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: EnterpriseScaleVO) => {
+  reset();
+  const _id = row?.id || ids.value[0];
+  const res = await getEnterpriseScale(_id);
+  Object.assign(form.value, res.data);
+  dialog.visible = true;
+  dialog.title = '修改企业规模';
+};
+
+/** 提交按钮 */
+const submitForm = () => {
+  enterpriseScaleFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      if (form.value.id) {
+        await updateEnterpriseScale(form.value).finally(() => (buttonLoading.value = false));
+      } else {
+        await addEnterpriseScale(form.value).finally(() => (buttonLoading.value = false));
+      }
+      proxy?.$modal.msgSuccess('操作成功');
+      dialog.visible = false;
+      await getList();
+    }
+  });
+};
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: EnterpriseScaleVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除企业规模编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
+  await delEnterpriseScale(_ids);
+  proxy?.$modal.msgSuccess('删除成功');
+  await getList();
+};
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download(
+    'customer/enterpriseScale/export',
+    {
+      ...queryParams.value
+    },
+    `enterpriseScale_${new Date().getTime()}.xlsx`
+  );
+};
+
+onMounted(() => {
+  getList();
+});
+</script>

+ 211 - 0
src/views/customer/industryCategory/index.vue

@@ -0,0 +1,211 @@
+<template>
+  <div class="p-2">
+    <el-card shadow="never">
+      <template #header>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="21">
+            <span>标签类别信息列表</span>
+          </el-col>
+          <el-col :span="1.5">
+            <el-button
+              type="danger"
+              plain
+              icon="Delete"
+              :disabled="multiple"
+              @click="handleDelete()"
+              v-hasPermi="['customer:industryCategory:remove']"
+              >批量删除</el-button
+            >
+          </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['customer:industryCategory:add']">新增</el-button>
+          </el-col>
+        </el-row>
+      </template>
+
+      <el-table v-loading="loading" border :data="industryCategoryList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="编号" align="center" prop="industryCode" />
+        <el-table-column label="所属行业" align="center" prop="industryCategoryName" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template #default="scope">
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['customer:industryCategory:edit']"
+              >编辑</el-button
+            >
+            <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['customer:industryCategory:remove']"
+              >删除</el-button
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+    </el-card>
+    <!-- 添加或修改所属行业对话框 -->
+    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
+      <el-form ref="industryCategoryFormRef" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="所属行业" prop="industryCategoryName">
+          <el-input v-model="form.industryCategoryName" placeholder="请输入所属行业" />
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="IndustryCategory" lang="ts">
+import {
+  listIndustryCategory,
+  getIndustryCategory,
+  delIndustryCategory,
+  addIndustryCategory,
+  updateIndustryCategory
+} from '@/api/customer/industryCategory';
+import { IndustryCategoryVO, IndustryCategoryQuery, IndustryCategoryForm } from '@/api/customer/industryCategory/types';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+const industryCategoryList = ref<IndustryCategoryVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+const queryFormRef = ref<ElFormInstance>();
+const industryCategoryFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: IndustryCategoryForm = {
+  id: undefined,
+  industryCategoryName: undefined,
+  status: undefined,
+  remark: undefined,
+  platformCode: undefined
+};
+const data = reactive<PageData<IndustryCategoryForm, IndustryCategoryQuery>>({
+  form: { ...initFormData },
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    industryCategoryName: undefined,
+    status: undefined,
+    platformCode: undefined,
+    params: {}
+  },
+  rules: {
+    industryCategoryName: [{ required: true, message: '所属行业不能为空', trigger: 'blur' }]
+  }
+});
+
+const { queryParams, form, rules } = toRefs(data);
+
+/** 查询所属行业列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listIndustryCategory(queryParams.value);
+  industryCategoryList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = { ...initFormData };
+  industryCategoryFormRef.value?.resetFields();
+};
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+};
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+};
+
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: IndustryCategoryVO[]) => {
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+};
+
+/** 新增按钮操作 */
+const handleAdd = () => {
+  reset();
+  dialog.visible = true;
+  dialog.title = '添加所属行业';
+};
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: IndustryCategoryVO) => {
+  reset();
+  const _id = row?.id || ids.value[0];
+  const res = await getIndustryCategory(_id);
+  Object.assign(form.value, res.data);
+  dialog.visible = true;
+  dialog.title = '修改所属行业';
+};
+
+/** 提交按钮 */
+const submitForm = () => {
+  industryCategoryFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      if (form.value.id) {
+        await updateIndustryCategory(form.value).finally(() => (buttonLoading.value = false));
+      } else {
+        await addIndustryCategory(form.value).finally(() => (buttonLoading.value = false));
+      }
+      proxy?.$modal.msgSuccess('操作成功');
+      dialog.visible = false;
+      await getList();
+    }
+  });
+};
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: IndustryCategoryVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除所属行业编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
+  await delIndustryCategory(_ids);
+  proxy?.$modal.msgSuccess('删除成功');
+  await getList();
+};
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download(
+    'customer/industryCategory/export',
+    {
+      ...queryParams.value
+    },
+    `industryCategory_${new Date().getTime()}.xlsx`
+  );
+};
+
+onMounted(() => {
+  getList();
+});
+</script>

+ 231 - 0
src/views/product/stockUp/index.vue

@@ -0,0 +1,231 @@
+<template>
+  <div class="p-2">
+    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
+      <div v-show="showSearch" class="mb-[10px]">
+        <el-card shadow="hover">
+          <el-form ref="queryFormRef" :model="queryParams" :inline="true">
+            <el-form-item label="属性名称" prop="stockName">
+              <el-input v-model="queryParams.stockName" placeholder="请输入属性名称" clearable @keyup.enter="handleQuery" />
+            </el-form-item>
+            <el-form-item>
+              <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
+              <el-button icon="Refresh" @click="resetQuery">重置</el-button>
+            </el-form-item>
+          </el-form>
+        </el-card>
+      </div>
+    </transition>
+
+    <el-card shadow="never">
+      <template #header>
+        <el-row :gutter="10" class="mb8">
+          <el-col :span="22"><span>商品备货属性信息列表</span> </el-col>
+          <el-col :span="1.5">
+            <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:comCurrency:add']">新增</el-button>
+          </el-col>
+        </el-row>
+      </template>
+
+      <el-table v-loading="loading" border :data="stockUpList" @selection-change="handleSelectionChange">
+        <el-table-column type="selection" width="55" align="center" />
+        <el-table-column label="属性编号" align="center" prop="stockNo" />
+        <el-table-column label="属性名称" align="center" prop="stockName" />
+        <el-table-column label="是否显示" align="center" prop="isShow">
+          <template #default="scope">
+            <el-switch v-model="scope.row.isShow" active-value="0" inactive-value="1" @change="handleStatusChange(scope.row)"></el-switch>
+          </template>
+        </el-table-column>
+        <el-table-column label="备注" align="center" prop="remark" />
+        <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+          <template #default="scope">
+            <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:stockUp:edit']">编辑</el-button>
+            <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:stockUp:remove']">删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+
+      <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
+    </el-card>
+    <!-- 添加或修改商品备货属性对话框 -->
+    <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
+      <el-form ref="stockUpFormRef" :model="form" :rules="rules" label-width="80px">
+        <el-form-item label="属性名称" prop="stockName">
+          <el-input v-model="form.stockName" placeholder="请输入属性名称" />
+        </el-form-item>
+        <el-form-item label="是否显示" prop="isShow">
+          <el-radio-group v-model="form.isShow">
+            <el-radio v-for="dict in sys_platform_yes_no" :key="dict.value" :value="dict.value">{{ dict.label }}</el-radio>
+          </el-radio-group>
+        </el-form-item>
+      </el-form>
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
+          <el-button @click="cancel">取 消</el-button>
+        </div>
+      </template>
+    </el-dialog>
+  </div>
+</template>
+
+<script setup name="StockUp" lang="ts">
+import { listStockUp, getStockUp, delStockUp, addStockUp, updateStockUp, changeStatus } from '@/api/product/stockUp';
+import { StockUpVO, StockUpQuery, StockUpForm } from '@/api/product/stockUp/types';
+
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+const { sys_platform_yes_no } = toRefs<any>(proxy?.useDict('sys_platform_yes_no'));
+
+const stockUpList = ref<StockUpVO[]>([]);
+const buttonLoading = ref(false);
+const loading = ref(true);
+const showSearch = ref(true);
+const ids = ref<Array<string | number>>([]);
+const single = ref(true);
+const multiple = ref(true);
+const total = ref(0);
+
+const queryFormRef = ref<ElFormInstance>();
+const stockUpFormRef = ref<ElFormInstance>();
+
+const dialog = reactive<DialogOption>({
+  visible: false,
+  title: ''
+});
+
+const initFormData: StockUpForm = {
+  id: undefined,
+  stockNo: undefined,
+  stockName: undefined,
+  isShow: '0',
+  dataSource: undefined,
+  status: undefined,
+  remark: undefined
+};
+const data = reactive<PageData<StockUpForm, StockUpQuery>>({
+  form: { ...initFormData },
+  queryParams: {
+    pageNum: 1,
+    pageSize: 10,
+    stockNo: undefined,
+    stockName: undefined,
+    isShow: undefined,
+    dataSource: undefined,
+    status: undefined,
+    platformCode: undefined,
+    params: {}
+  },
+  rules: {
+    stockName: [{ required: true, message: '属性名称不能为空', trigger: 'blur' }]
+  }
+});
+
+const { queryParams, form, rules } = toRefs(data);
+
+/** 查询商品备货属性列表 */
+const getList = async () => {
+  loading.value = true;
+  const res = await listStockUp(queryParams.value);
+  stockUpList.value = res.rows;
+  total.value = res.total;
+  loading.value = false;
+};
+
+/** 取消按钮 */
+const cancel = () => {
+  reset();
+  dialog.visible = false;
+};
+
+/** 表单重置 */
+const reset = () => {
+  form.value = { ...initFormData };
+  stockUpFormRef.value?.resetFields();
+};
+
+/** 搜索按钮操作 */
+const handleQuery = () => {
+  queryParams.value.pageNum = 1;
+  getList();
+};
+
+/** 重置按钮操作 */
+const resetQuery = () => {
+  queryFormRef.value?.resetFields();
+  handleQuery();
+};
+const handleStatusChange = async (row: StockUpVO) => {
+  const oldValue = row.isShow; // 保存旧值(0 或 1)
+
+  try {
+    await changeStatus(row.id, row.isShow); // 传新值
+    proxy?.$modal.msgSuccess('操作成功');
+  } catch {
+    row.isShow = oldValue; // 失败回滚
+    proxy?.$modal.msgError('操作失败,请重试');
+  }
+};
+/** 多选框选中数据 */
+const handleSelectionChange = (selection: StockUpVO[]) => {
+  ids.value = selection.map((item) => item.id);
+  single.value = selection.length != 1;
+  multiple.value = !selection.length;
+};
+
+/** 新增按钮操作 */
+const handleAdd = () => {
+  reset();
+  dialog.visible = true;
+  dialog.title = '添加商品备货属性';
+};
+
+/** 修改按钮操作 */
+const handleUpdate = async (row?: StockUpVO) => {
+  reset();
+  const _id = row?.id || ids.value[0];
+  const res = await getStockUp(_id);
+  Object.assign(form.value, res.data);
+  dialog.visible = true;
+  dialog.title = '修改商品备货属性';
+};
+
+/** 提交按钮 */
+const submitForm = () => {
+  stockUpFormRef.value?.validate(async (valid: boolean) => {
+    if (valid) {
+      buttonLoading.value = true;
+      if (form.value.id) {
+        await updateStockUp(form.value).finally(() => (buttonLoading.value = false));
+      } else {
+        await addStockUp(form.value).finally(() => (buttonLoading.value = false));
+      }
+      proxy?.$modal.msgSuccess('操作成功');
+      dialog.visible = false;
+      await getList();
+    }
+  });
+};
+
+/** 删除按钮操作 */
+const handleDelete = async (row?: StockUpVO) => {
+  const _ids = row?.id || ids.value;
+  await proxy?.$modal.confirm('是否确认删除商品备货属性编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
+  await delStockUp(_ids);
+  proxy?.$modal.msgSuccess('删除成功');
+  await getList();
+};
+
+/** 导出按钮操作 */
+const handleExport = () => {
+  proxy?.download(
+    'system/stockUp/export',
+    {
+      ...queryParams.value
+    },
+    `stockUp_${new Date().getTime()}.xlsx`
+  );
+};
+
+onMounted(() => {
+  getList();
+});
+</script>

+ 39 - 42
src/views/system/level/index.vue

@@ -20,9 +20,7 @@
     </transition>
 
     <el-card shadow="never">
-      <template #header>
-        供应商等级信息列表
-      </template>
+      <template #header> 供应商等级信息列表 </template>
 
       <el-table v-loading="loading" border :data="levelList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
@@ -98,24 +96,19 @@ const dialog = reactive<DialogOption>({
 
 const initFormData: LevelForm = {
   supplierLevelName: undefined,
-  isShow: undefined,
-}
+  isShow: undefined
+};
 const data = reactive<PageData<LevelForm, LevelQuery>>({
-  form: {...initFormData},
+  form: { ...initFormData },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
     dataSource: undefined,
-    params: {
-    }
+    params: {}
   },
   rules: {
-    supplierLevelName: [
-      { required: true, message: "名称不能为空", trigger: "blur" }
-    ],
-    isShow: [
-      { required: true, message: "是否展示不能为空", trigger: "blur" }
-    ],
+    supplierLevelName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
+    isShow: [{ required: true, message: '是否展示不能为空', trigger: 'blur' }]
   }
 });
 
@@ -128,63 +121,63 @@ const getList = async () => {
   levelList.value = res.rows;
   total.value = res.total;
   loading.value = false;
-}
+};
 
 /** 取消按钮 */
 const cancel = () => {
   reset();
   dialog.visible = false;
-}
+};
 
 /** 表单重置 */
 const reset = () => {
-  form.value = {...initFormData};
+  form.value = { ...initFormData };
   levelFormRef.value?.resetFields();
-}
+};
 
 /** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.value.pageNum = 1;
   getList();
-}
+};
 
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryFormRef.value?.resetFields();
   handleQuery();
-}
+};
 
 /** 多选框选中数据 */
 const handleSelectionChange = (selection: LevelVO[]) => {
-  ids.value = selection.map(item => item.supplierLevelNo);
+  ids.value = selection.map((item) => item.supplierLevelNo);
   single.value = selection.length != 1;
   multiple.value = !selection.length;
-}
+};
 
 /** 是否展示状态修改 */
 const handleIsShowChange = async (row: LevelVO) => {
   await updateLevel(row);
-  proxy?.$modal.msgSuccess("修改成功");
-}
+  proxy?.$modal.msgSuccess('修改成功');
+};
 
 /** 新增按钮操作 */
 const handleAdd = () => {
   reset();
   form.value.dataSource = queryParams.value.dataSource;
   dialog.visible = true;
-  dialog.title = "添加供应商等级";
-}
+  dialog.title = '添加供应商等级';
+};
 
 /** 修改按钮操作 */
 const handleUpdate = async (row?: LevelVO) => {
   reset();
   const _datasource = row?.dataSource || queryParams.value.dataSource;
-  const _supplierLevelNo = row?.supplierLevelNo || ids.value[0] as string;
+  const _supplierLevelNo = row?.supplierLevelNo || (ids.value[0] as string);
   const res = await getLevel(_datasource, _supplierLevelNo);
   Object.assign(form.value, res.data);
   dialog.visible = true;
-  dialog.title = "修改供应商等级";
-}
+  dialog.title = '修改供应商等级';
+};
 
 /** 提交按钮 */
 const submitForm = () => {
@@ -192,32 +185,36 @@ const submitForm = () => {
     if (valid) {
       buttonLoading.value = true;
       if (form.value.supplierLevelNo) {
-        await updateLevel(form.value).finally(() =>  buttonLoading.value = false);
+        await updateLevel(form.value).finally(() => (buttonLoading.value = false));
       } else {
-        await addLevel(form.value).finally(() =>  buttonLoading.value = false);
+        await addLevel(form.value).finally(() => (buttonLoading.value = false));
       }
-      proxy?.$modal.msgSuccess("操作成功");
+      proxy?.$modal.msgSuccess('操作成功');
       dialog.visible = false;
       await getList();
     }
   });
-}
+};
 
 /** 删除按钮操作 */
 const handleDelete = async (row?: LevelVO) => {
   const _supplierLevelNos = row?.supplierLevelNo || ids.value;
-  await proxy?.$modal.confirm('是否确认删除供应商等级编号为"' + _supplierLevelNos + '"的数据项?').finally(() => loading.value = false);
+  await proxy?.$modal.confirm('是否确认删除供应商等级编号为"' + _supplierLevelNos + '"的数据项?').finally(() => (loading.value = false));
   await delLevel(_supplierLevelNos);
-  proxy?.$modal.msgSuccess("删除成功");
+  proxy?.$modal.msgSuccess('删除成功');
   await getList();
-}
+};
 
 /** 导出按钮操作 */
 const handleExport = () => {
-  proxy?.download('system/level/export', {
-    ...queryParams.value
-  }, `level_${new Date().getTime()}.xlsx`)
-}
+  proxy?.download(
+    'system/level/export',
+    {
+      ...queryParams.value
+    },
+    `level_${new Date().getTime()}.xlsx`
+  );
+};
 
 /** 获取数据来源列表 */
 const fetchDataSourceList = async () => {
@@ -225,9 +222,9 @@ const fetchDataSourceList = async () => {
   dataSourceOptions.value = res.data;
   // 默认选中第一个数据源
   if (dataSourceOptions.value.length > 0) {
-    queryParams.value.dataSource = dataSourceOptions.value[0].dataSourceNm;
+    queryParams.value.dataSource = dataSourceOptions.value[1].dataSourceNm;
   }
-}
+};
 
 onMounted(async () => {
   await fetchDataSourceList();

+ 40 - 43
src/views/system/type/index.vue

@@ -12,7 +12,7 @@
             <el-form-item>
               <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
               <el-button icon="Refresh" @click="resetQuery">重置</el-button>
-               <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:type:add']">新增</el-button>
+              <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:type:add']">新增</el-button>
             </el-form-item>
           </el-form>
         </el-card>
@@ -20,9 +20,7 @@
     </transition>
 
     <el-card shadow="never">
-      <template #header>
-        供应商类别信息列表
-      </template>
+      <template #header> 供应商类别信息列表 </template>
 
       <el-table v-loading="loading" border :data="typeList" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" align="center" />
@@ -98,24 +96,19 @@ const dialog = reactive<DialogOption>({
 
 const initFormData: TypeForm = {
   supplierTypeName: undefined,
-  isShow: undefined,
-}
+  isShow: undefined
+};
 const data = reactive<PageData<TypeForm, TypeQuery>>({
-  form: {...initFormData},
+  form: { ...initFormData },
   queryParams: {
     pageNum: 1,
     pageSize: 10,
     dataSource: undefined,
-    params: {
-    }
+    params: {}
   },
   rules: {
-    supplierTypeName: [
-      { required: true, message: "名称不能为空", trigger: "blur" }
-    ],
-    isShow: [
-      { required: true, message: "是否展示不能为空", trigger: "blur" }
-    ],
+    supplierTypeName: [{ required: true, message: '名称不能为空', trigger: 'blur' }],
+    isShow: [{ required: true, message: '是否展示不能为空', trigger: 'blur' }]
   }
 });
 
@@ -128,63 +121,63 @@ const getList = async () => {
   typeList.value = res.rows;
   total.value = res.total;
   loading.value = false;
-}
+};
 
 /** 取消按钮 */
 const cancel = () => {
   reset();
   dialog.visible = false;
-}
+};
 
 /** 表单重置 */
 const reset = () => {
-  form.value = {...initFormData};
+  form.value = { ...initFormData };
   typeFormRef.value?.resetFields();
-}
+};
 
 /** 搜索按钮操作 */
 const handleQuery = () => {
   queryParams.value.pageNum = 1;
   getList();
-}
+};
 
 /** 重置按钮操作 */
 const resetQuery = () => {
   queryFormRef.value?.resetFields();
   handleQuery();
-}
+};
 
 /** 多选框选中数据 */
 const handleSelectionChange = (selection: TypeVO[]) => {
-  ids.value = selection.map(item => item.supplierTypeNo);
+  ids.value = selection.map((item) => item.supplierTypeNo);
   single.value = selection.length != 1;
   multiple.value = !selection.length;
-}
+};
 
 /** 是否展示状态修改 */
 const handleIsShowChange = async (row: TypeVO) => {
   await updateType(row);
-  proxy?.$modal.msgSuccess("修改成功");
-}
+  proxy?.$modal.msgSuccess('修改成功');
+};
 
 /** 新增按钮操作 */
 const handleAdd = () => {
   reset();
   form.value.dataSource = queryParams.value.dataSource;
   dialog.visible = true;
-  dialog.title = "添加供应商类别";
-}
+  dialog.title = '添加供应商类别';
+};
 
 /** 修改按钮操作 */
 const handleUpdate = async (row?: TypeVO) => {
   reset();
   const _datasource = row?.dataSource || queryParams.value.dataSource;
-  const _supplierTypeNo = row?.supplierTypeNo || ids.value[0] as string;
+  const _supplierTypeNo = row?.supplierTypeNo || (ids.value[0] as string);
   const res = await getType(_datasource, _supplierTypeNo);
   Object.assign(form.value, res.data);
   dialog.visible = true;
-  dialog.title = "修改供应商类别";
-}
+  dialog.title = '修改供应商类别';
+};
 
 /** 提交按钮 */
 const submitForm = () => {
@@ -192,32 +185,36 @@ const submitForm = () => {
     if (valid) {
       buttonLoading.value = true;
       if (form.value.supplierTypeNo) {
-        await updateType(form.value).finally(() =>  buttonLoading.value = false);
+        await updateType(form.value).finally(() => (buttonLoading.value = false));
       } else {
-        await addType(form.value).finally(() =>  buttonLoading.value = false);
+        await addType(form.value).finally(() => (buttonLoading.value = false));
       }
-      proxy?.$modal.msgSuccess("操作成功");
+      proxy?.$modal.msgSuccess('操作成功');
       dialog.visible = false;
       await getList();
     }
   });
-}
+};
 
 /** 删除按钮操作 */
 const handleDelete = async (row?: TypeVO) => {
   const _supplierTypeNos = row?.supplierTypeNo || ids.value;
-  await proxy?.$modal.confirm('是否确认删除供应商类别编号为"' + _supplierTypeNos + '"的数据项?').finally(() => loading.value = false);
+  await proxy?.$modal.confirm('是否确认删除供应商类别编号为"' + _supplierTypeNos + '"的数据项?').finally(() => (loading.value = false));
   await delType(_supplierTypeNos);
-  proxy?.$modal.msgSuccess("删除成功");
+  proxy?.$modal.msgSuccess('删除成功');
   await getList();
-}
+};
 
 /** 导出按钮操作 */
 const handleExport = () => {
-  proxy?.download('system/type/export', {
-    ...queryParams.value
-  }, `type_${new Date().getTime()}.xlsx`)
-}
+  proxy?.download(
+    'system/type/export',
+    {
+      ...queryParams.value
+    },
+    `type_${new Date().getTime()}.xlsx`
+  );
+};
 
 /** 获取数据来源列表 */
 const fetchDataSourceList = async () => {
@@ -225,9 +222,9 @@ const fetchDataSourceList = async () => {
   dataSourceOptions.value = res.data;
   // 默认选中第一个数据源
   if (dataSourceOptions.value.length > 0) {
-    queryParams.value.dataSource = dataSourceOptions.value[0].dataSourceNm;
+    queryParams.value.dataSource = dataSourceOptions.value[1].dataSourceNm;
   }
-}
+};
 
 onMounted(async () => {
   await fetchDataSourceList();