Просмотр исходного кода

feat(price-approval): 新增商品添加功能

- 添加 AddPage 组件用于商品添加
- 在 DataTable 组件中增加新增按钮和相关逻辑
- 修改路由配置,添加新的商品添加页面路由
- 优化成本查看页面布局和样式
WanGxC 8 месяцев назад
Родитель
Сommit
da0a3a30ac

+ 2 - 2
.env.development

@@ -4,8 +4,8 @@ ENV='development'
 # 本地环境接口地址
 # VITE_API_URL = 'http://127.0.0.1:8000'
 VITE_API_URL='http://192.168.1.225:82/'
-# VUE_APP_API="http://operate.zosi.com.cn/"
-# VUE_APP_API="http://192.168.1.225:82/"
+# VITE_API_URL='http://operate.zosi.com.cn/'
+# VITE_API_URL="http://192.168.1.225:82/"
 
 # 是否启用按钮权限
 VITE_PM_ENABLED=true

+ 236 - 0
src/views/price-approval/approval-review-supply/component/AddPage.vue

@@ -0,0 +1,236 @@
+<script lang="ts" setup>
+/**
+ * @Name: AddPage.vue
+ * @Description: 商品添加-供货
+ * @Author: Cheney
+ */
+
+import { FormInstance, FormRules } from 'element-plus';
+import { Finished, RefreshLeft, Select } from '@element-plus/icons-vue';
+
+
+const route = useRoute();
+const routeQuery: any = ref(route.query);
+
+interface RuleForm {
+  country: any;
+  platform: any;
+  sku: any;
+  weight: any;
+  currency_code: any;
+  price_market_ref: any;
+  estimated_cost: any;
+  final_cost: any;
+  price_market: any;
+  price_supply: any;
+  cost: any;
+  price_show: any;
+  price_daily: any;
+  price_min: any;
+}
+
+const ruleFormRef = ref<FormInstance>();
+const ruleForm = reactive<RuleForm>({
+  country: '',
+  platform: '',
+  sku: '',
+  weight: '',
+  currency_code: '',
+  price_market_ref: '',
+  estimated_cost: '',
+  final_cost: '',
+  price_market: '',
+  price_supply: '',
+  cost: '',
+  price_show: '',
+  price_daily: '',
+  price_min: ''
+});
+
+const rules = reactive<FormRules<RuleForm>>({
+  sku: [ { required: true, message: '请输入SKU', trigger: 'blur' } ],
+  platform: [ { required: true, message: '请输入平台', trigger: 'blur' } ],
+  country: [ { required: true, message: '请输入国家', trigger: 'blur' } ],
+  currency_code: [ { required: true, message: '请选择货币代码', trigger: 'change' } ],
+  price_supply: [ { required: true, message: '请输入供货价', trigger: 'blur' } ],
+  estimated_cost: [ { required: true, message: '请输入预估成本', trigger: 'blur' } ]
+});
+
+const loading = ref(false);
+
+const submitForm = async (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  await formEl.validate((valid, fields) => {
+    if (valid) {
+      console.log('submit!');
+    } else {
+      console.log('error submit!', fields);
+    }
+  });
+};
+
+const resetForm = (formEl: FormInstance | undefined) => {
+  if (!formEl) return;
+  formEl.resetFields();
+};
+</script>
+
+<template>
+  <div class="p-5">
+    <el-card class="h-full" style="color: rgba(0, 0, 0, 0.88);">
+      <template #header>
+      <span class="text-lg">
+        商品添加 -- {{ routeQuery.type === 'supply' ? '供货' : '直销' }}
+      </span>
+      </template>
+      <div class="w-full">
+        <!-- 供货 -->
+        <el-form v-if="routeQuery.type === 'supply'" ref="ruleFormRef" :model="ruleForm" :rules="rules" class="mx-2.5"
+                 label-position="top"
+                 label-width="auto" status-icon>
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="国 家" prop="country">
+                <el-input v-model="ruleForm.country" placeholder="请输入国家" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="平 台" prop="platform">
+                <el-input v-model="ruleForm.platform" placeholder="请输入平台" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="SKU" prop="sku">
+                <el-input v-model="ruleForm.sku" placeholder="请输入SKU" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="重 量(KG)" prop="weight">
+                <el-input v-model="ruleForm.weight" placeholder="请输入重量" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="货币代码" prop="currency_code">
+                <el-select v-model="ruleForm.currency_code" placeholder="请选择货币代码">
+                  <el-option label="1" value="1"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="卖场参考价" prop="price_market_ref">
+                <el-input v-model="ruleForm.price_market_ref" placeholder="请输入卖场参考价" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="预估硬件成本" prop="estimated_cost">
+                <el-input v-model="ruleForm.estimated_cost" placeholder="请输入预估硬件成本" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="尾段成本" prop="final_cost">
+                <el-input v-model="ruleForm.final_cost" placeholder="请输入尾段成本" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" style="margin-bottom: 5px;">
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="卖场价(不含VAT)" prop="price_market">
+                <el-input v-model="ruleForm.price_market" placeholder="请输入卖场价" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="供货价" prop="price_supply">
+                <el-input v-model="ruleForm.price_supply" placeholder="请输入供货价" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="成 本" prop="cost">
+                <el-button v-model="ruleForm.cost" :icon="Select" class="w-full" plain type="primary">选 择</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+        <!-- 直销 -->
+        <el-form v-else ref="ruleFormRef" :model="ruleForm" :rules="rules" class="mx-2.5"
+                 label-position="top"
+                 label-width="auto" status-icon>
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="国 家" prop="country">
+                <el-input v-model="ruleForm.country" placeholder="请输入国家" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="平 台" prop="platform">
+                <el-input v-model="ruleForm.platform" placeholder="请输入平台" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="SKU" prop="sku">
+                <el-input v-model="ruleForm.sku" placeholder="请输入SKU" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="重 量(KG)" prop="weight">
+                <el-input v-model="ruleForm.weight" placeholder="请输入重量" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20">
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="货币代码" prop="currency_code">
+                <el-select v-model="ruleForm.currency_code" placeholder="请选择货币代码">
+                  <el-option label="1" value="1"></el-option>
+                </el-select>
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="展示价格" prop="price_show">
+                <el-input v-model="ruleForm.price_show" placeholder="请输入展示价格" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="日常活动售价" prop="price_daily">
+                <el-input v-model="ruleForm.price_daily" placeholder="请输入日常活动售价" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="最低活动价" prop="price_min">
+                <el-input v-model="ruleForm.price_min" placeholder="请输入最低活动价" />
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row :gutter="20" style="margin-bottom: 5px;">
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="预估硬件成本" prop="estimated_cost">
+                <el-input v-model="ruleForm.estimated_cost" placeholder="请输入预估成本" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="尾段成本" prop="final_cost">
+                <el-input v-model="ruleForm.final_cost" placeholder="请输入尾段成本" />
+              </el-form-item>
+            </el-col>
+            <el-col :span="6">
+              <el-form-item class="font-medium" label="成 本" prop="cost">
+                <el-button v-model="ruleForm.cost" :icon="Select" class="w-full" plain type="primary">选 择</el-button>
+              </el-form-item>
+            </el-col>
+          </el-row>
+        </el-form>
+      </div>
+      <template #footer>
+        <div class="flex justify-end">
+          <el-button :icon="RefreshLeft" @click="resetForm(ruleFormRef)">重 置</el-button>
+          <el-button :icon="Finished" :loading="loading" type="primary" @click="submitForm(ruleFormRef)">确 定</el-button>
+        </div>
+      </template>
+    </el-card>
+  </div>
+</template>
+
+<style scoped>
+
+</style>

+ 203 - 201
src/views/price-approval/approval-review-supply/component/DataTable.vue

@@ -21,10 +21,12 @@ import { useResponse } from '/@/utils/useResponse';
 import { CostDetailColumns, SupplyCheckColumns_Regular } from '/@/views/price-approval/Columns';
 
 
+const router = useRouter();
+
 interface Parameter {
-	description: string;
-	platform: string;
-	station: string;
+  description: string;
+  platform: string;
+  station: string;
 }
 
 const queryParameter: Parameter | undefined = inject('query-parameter');
@@ -32,37 +34,37 @@ const { tableOptions, handlePageChange } = usePagination(fetchList);
 
 const gridRef = ref();
 const gridOptions: any = reactive({
-	size: 'mini',
-	border: false,
-	round: true,
-	stripe: true,
-	currentRowHighLight: true,
-	height: '100%',
-	toolbarConfig: {
-		size: 'large',
-		slots: {
-			buttons: 'toolbar_buttons',
-			tools: 'toolbar_tools',
-		},
-	},
-	rowConfig: {
-		isHover: true,
-	},
-	columnConfig: {
-		resizable: true,
-	},
-	pagerConfig: {
-		total: tableOptions.value.total,
-		page: tableOptions.value.page,
-		limit: tableOptions.value.limit,
-	},
-	loading: false,
-	loadingConfig: {
-		icon: 'vxe-icon-indicator roll',
-		text: '正在拼命加载中...',
-	},
-	columns: '',
-	data: '',
+  size: 'mini',
+  border: false,
+  round: true,
+  stripe: true,
+  currentRowHighLight: true,
+  height: '100%',
+  toolbarConfig: {
+    size: 'large',
+    slots: {
+      buttons: 'toolbar_buttons',
+      tools: 'toolbar_tools'
+    }
+  },
+  rowConfig: {
+    isHover: true
+  },
+  columnConfig: {
+    resizable: true
+  },
+  pagerConfig: {
+    total: tableOptions.value.total,
+    page: tableOptions.value.page,
+    limit: tableOptions.value.limit
+  },
+  loading: false,
+  loadingConfig: {
+    icon: 'vxe-icon-indicator roll',
+    text: '正在拼命加载中...'
+  },
+  columns: '',
+  data: ''
 });
 
 const checkedList = ref<Set<number>>(new Set());
@@ -76,220 +78,220 @@ const dialogVisible = ref(false);
 const templateType = ref('cost');
 
 onBeforeMount(() => {
-	gridOptions.pagerConfig.limit = 10;
+  gridOptions.pagerConfig.limit = 10;
 });
 
 onMounted(() => {
-	fetchList();
+  fetchList();
 });
 
 async function fetchList(isQuery = false) {
-	if (isQuery) {
-		gridOptions.pagerConfig.page = 1;
-	}
-
-	gridOptions.data = [];
-	gridOptions.columns = [];
-
-	const query = {
-		description: queryParameter?.description,
-		platform: queryParameter?.platform,
-		station: queryParameter?.station,
-	};
-
-	await useTableData(api.getTableData, query, gridOptions);
-	await gridRef.value.loadColumn(SupplyCheckColumns_Regular);
-	gridOptions.showHeader = Boolean(gridOptions.data?.length);
+  if (isQuery) {
+    gridOptions.pagerConfig.page = 1;
+  }
+
+  gridOptions.data = [];
+  gridOptions.columns = [];
+
+  const query = {
+    description: queryParameter?.description,
+    platform: queryParameter?.platform,
+    station: queryParameter?.station
+  };
+
+  await useTableData(api.getTableData, query, gridOptions);
+  await gridRef.value.loadColumn(SupplyCheckColumns_Regular);
+  gridOptions.showHeader = Boolean(gridOptions.data?.length);
 }
 
 function handleRefresh() {
-	fetchList();
+  fetchList();
 }
 
 async function handleDownload() {
-	gridOptions.loading = true;
-	try {
-		const query = {
-			description: queryParameter?.description,
-			platform: queryParameter?.platform,
-			station: queryParameter?.station,
-		};
-		const response = await api.exportData(query);
-		const url = window.URL.createObjectURL(new Blob([response.data]));
-		const link = document.createElement('a');
-		link.href = url;
-		link.setAttribute('download', '商品列表数据.xlsx');
-		document.body.appendChild(link);
-		link.click();
-		ElMessage.success('数据导出成功!');
-	} catch (error) {
-		ElMessage.error('数据导出失败,请重试!');
-		console.error(error);
-	} finally {
-		gridOptions.loading = false; // 结束加载状态
-	}
+  gridOptions.loading = true;
+  try {
+    const query = {
+      description: queryParameter?.description,
+      platform: queryParameter?.platform,
+      station: queryParameter?.station
+    };
+    const response = await api.exportData(query);
+    const url = window.URL.createObjectURL(new Blob([ response.data ]));
+    const link = document.createElement('a');
+    link.href = url;
+    link.setAttribute('download', '商品列表数据.xlsx');
+    document.body.appendChild(link);
+    link.click();
+    ElMessage.success('数据导出成功!');
+  } catch (error) {
+    ElMessage.error('数据导出失败,请重试!');
+    console.error(error);
+  } finally {
+    gridOptions.loading = false; // 结束加载状态
+  }
 }
 
 function selectChangeEvent({ checked, row }: any) {
-	if (checked) {
-		checkedList.value.add(row.id); // 获取单个数据
-	} else {
-		checkedList.value.delete(row.id);
-	}
+  if (checked) {
+    checkedList.value.add(row.id); // 获取单个数据
+  } else {
+    checkedList.value.delete(row.id);
+  }
 }
 
 function selectAllChangeEvent({ checked }: any) {
-	const $grid = gridRef.value;
-	if ($grid) {
-		const records = $grid.getData(); // 获取所有数据
-		if (checked) {
-			records.forEach((item: any) => {
-				checkedList.value.add(item.id);
-			});
-		} else {
-			checkedList.value.clear();
-		}
-	}
+  const $grid = gridRef.value;
+  if ($grid) {
+    const records = $grid.getData(); // 获取所有数据
+    if (checked) {
+      records.forEach((item: any) => {
+        checkedList.value.add(item.id);
+      });
+    } else {
+      checkedList.value.clear();
+    }
+  }
 }
 
 function handleCreate() {
-
+  router.push({ name: 'SupplyAddPage', query: { type: 'supply' } });
 }
 
 function handleEdit(row: any) {
-	editOpen.value = true;
-	rowData.value = row;
+  editOpen.value = true;
+  rowData.value = row;
 }
 
 async function singleDelete(row: any) {
-	const res = await useResponse(api.deleteRow, row);
-	if (res.code === 2000) {
-		ElMessage.error({ message: '已删除!', plain: true, icon: 'Delete' });
-		handleRefresh();
-	}
+  const res = await useResponse(api.deleteRow, row);
+  if (res.code === 2000) {
+    ElMessage.error({ message: '已删除!', plain: true, icon: 'Delete' });
+    handleRefresh();
+  }
 }
 
-
 function downloadTemplate() {
-	const url = '/api/choice/reviews_monitor/import_data/';
-	const fileName = '商品监控模板.xlsx';
-
-	if (url) {
-		downloadFile({
-			url,
-			method: 'GET',
-			filename: fileName,
-		});
-	} else {
-		console.error('未知的模板类型:', templateType.value);
-	}
+  const url = '/api/choice/reviews_monitor/import_data/';
+  const fileName = '商品监控模板.xlsx';
+
+  if (url) {
+    downloadFile({
+      url,
+      method: 'GET',
+      filename: fileName
+    });
+  } else {
+    console.error('未知的模板类型:', templateType.value);
+  }
 }
 
 const gridEvents = {
-	custom({ type }: any) {
-		if (type == 'confirm') {
-			fetchList();
-		}
-	},
+  custom({ type }: any) {
+    if (type == 'confirm') {
+      fetchList();
+    }
+  }
 };
 
-function cellStyle(){
-	return{
-		fontWeight:500,
-	}
+function cellStyle() {
+  return {
+    fontWeight: 500
+  };
 }
 
 defineExpose({ fetchList });
 </script>
 
 <template>
-	<vxe-grid ref="gridRef" v-bind="gridOptions" v-on="gridEvents" @checkbox-change="selectChangeEvent" @checkbox-all="selectAllChangeEvent" :cell-style="cellStyle">
-		<!-- 工具栏左侧 -->
-		<template #toolbar_buttons>
-			<div class="flex gap-2">
-				<!--<div>-->
-				<!--	<el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220" @confirm="batchDelete">-->
-				<!--		<template #reference>-->
-				<!--			<PermissionButton :disabled="!checkedList.size" :icon="Delete" plain round type="danger"> 批量删除 </PermissionButton>-->
-				<!--		</template>-->
-				<!--		<template #actions="{ confirm, cancel }">-->
-				<!--			<el-button size="small" @click="cancel">No!</el-button>-->
-				<!--			<el-button size="small" type="danger" @click="confirm">Yes?</el-button>-->
-				<!--		</template>-->
-				<!--	</el-popconfirm>-->
-				<!--</div>-->
-				<div>
-					<PermissionButton :icon="Plus" plain round type="primary" @click="handleCreate">新 增</PermissionButton>
-				</div>
-				<div class="custom-el-input">
-					<el-select v-model="templateType" style="width: 190px">
-						<template #prefix>
-							<div class="flex items-center">
-								<el-button
-									size="small"
-									style="margin-left: -7px; font-size: 14px; border-radius: 29px"
-									text
-									type="success"
-									@click.stop="downloadTemplate"
-								>
-									下载
-								</el-button>
-								<VerticalDivider style="margin-left: 7px" />
-							</div>
-						</template>
-						<el-option label="成本查看模板" value="cost" />
-					</el-select>
-				</div>
-				<VerticalDivider class="px-1" style="margin-left: 7px" />
-				<ImportButton :icon="Upload" :uploadFunction="api.upload" bg text>导 入</ImportButton>
-			</div>
-		</template>
-		<!-- 工具栏右侧 -->
-		<template #toolbar_tools>
-			<el-button circle class="toolbar-btn" @click="handleRefresh">
-				<el-icon>
-					<Refresh />
-				</el-icon>
-			</el-button>
-			<el-button circle class="toolbar-btn" @click="handleDownload">
-				<el-icon>
-					<Download />
-				</el-icon>
-			</el-button>
-		</template>
-		<template #top>
-			<div class="mb-2"></div>
-		</template>
-		<!-- 分页 -->
-		<template #pager>
-			<vxe-pager
-				v-model:currentPage="gridOptions.pagerConfig.page"
-				v-model:pageSize="gridOptions.pagerConfig.limit"
-				:total="gridOptions.pagerConfig.total"
-				class="mt-1.5"
-				@page-change="handlePageChange"
-			/>
-		</template>
-		<template #empty>
-			<el-empty description="暂无数据" />
-		</template>
-		<!-- 自定义列插槽 -->
-		<template v-for="col in CostDetailColumns" #[`${col.field}`]="{ row }">
-			<DataTableSlot :field="col.field" :row="row" @edit-row="handleEdit" @handle-delete="singleDelete" />
-		</template>
-	</vxe-grid>
-	<EditDrawer v-if="editOpen" v-model="editOpen" :row-data="rowData" @refresh="handleRefresh" />
-	<NoticeDialog v-if="dialogVisible" v-model="dialogVisible" :row-data="rowData" />
+  <vxe-grid ref="gridRef" :cell-style="cellStyle" v-bind="gridOptions" v-on="gridEvents"
+            @checkbox-change="selectChangeEvent" @checkbox-all="selectAllChangeEvent">
+    <!-- 工具栏左侧 -->
+    <template #toolbar_buttons>
+      <div class="flex gap-2">
+        <!--<div>-->
+        <!--	<el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220" @confirm="batchDelete">-->
+        <!--		<template #reference>-->
+        <!--			<PermissionButton :disabled="!checkedList.size" :icon="Delete" plain round type="danger"> 批量删除 </PermissionButton>-->
+        <!--		</template>-->
+        <!--		<template #actions="{ confirm, cancel }">-->
+        <!--			<el-button size="small" @click="cancel">No!</el-button>-->
+        <!--			<el-button size="small" type="danger" @click="confirm">Yes?</el-button>-->
+        <!--		</template>-->
+        <!--	</el-popconfirm>-->
+        <!--</div>-->
+        <div>
+          <PermissionButton :icon="Plus" plain round type="primary" @click="handleCreate">新 增</PermissionButton>
+        </div>
+        <div class="custom-el-input">
+          <el-select v-model="templateType" style="width: 190px">
+            <template #prefix>
+              <div class="flex items-center">
+                <el-button
+                    size="small"
+                    style="margin-left: -7px; font-size: 14px; border-radius: 29px"
+                    text
+                    type="success"
+                    @click.stop="downloadTemplate"
+                >
+                  下载
+                </el-button>
+                <VerticalDivider style="margin-left: 7px" />
+              </div>
+            </template>
+            <el-option label="成本查看模板" value="cost" />
+          </el-select>
+        </div>
+        <VerticalDivider class="px-1" style="margin-left: 7px" />
+        <ImportButton :icon="Upload" :uploadFunction="api.upload" bg text>导 入</ImportButton>
+      </div>
+    </template>
+    <!-- 工具栏右侧 -->
+    <template #toolbar_tools>
+      <el-button circle class="toolbar-btn" @click="handleRefresh">
+        <el-icon>
+          <Refresh />
+        </el-icon>
+      </el-button>
+      <el-button circle class="toolbar-btn" @click="handleDownload">
+        <el-icon>
+          <Download />
+        </el-icon>
+      </el-button>
+    </template>
+    <template #top>
+      <div class="mb-2"></div>
+    </template>
+    <!-- 分页 -->
+    <template #pager>
+      <vxe-pager
+          v-model:currentPage="gridOptions.pagerConfig.page"
+          v-model:pageSize="gridOptions.pagerConfig.limit"
+          :total="gridOptions.pagerConfig.total"
+          class="mt-1.5"
+          @page-change="handlePageChange"
+      />
+    </template>
+    <template #empty>
+      <el-empty description="暂无数据" />
+    </template>
+    <!-- 自定义列插槽 -->
+    <template v-for="col in CostDetailColumns" #[`${col.field}`]="{ row }">
+      <DataTableSlot :field="col.field" :row="row" @edit-row="handleEdit" @handle-delete="singleDelete" />
+    </template>
+  </vxe-grid>
+  <EditDrawer v-if="editOpen" v-model="editOpen" :row-data="rowData" @refresh="handleRefresh" />
+  <NoticeDialog v-if="dialogVisible" v-model="dialogVisible" :row-data="rowData" />
 </template>
 
 <style scoped>
 .toolbar-btn {
-	width: 34px;
-	height: 34px;
-	font-size: 18px;
+  width: 34px;
+  height: 34px;
+  font-size: 18px;
 }
 
 :deep(.custom-el-input .el-select__wrapper) {
-	border-radius: 20px;
+  border-radius: 20px;
 }
 </style>

+ 67 - 71
src/views/price-approval/approval-review-supply/index.vue

@@ -1,21 +1,18 @@
-<script setup lang="ts">
+<script lang="ts" setup>
 /**
  * @Name: index.vue
  * @Description: 审批查看(供货)
  * @Author: Cheney
  */
 
-
 import VerticalDivider from '/src/components/VerticalDivider/index.vue';
 import { RefreshLeft, Search } from '@element-plus/icons-vue';
-import { DictionaryStore } from '/@/stores/dictionary';
 import { useResponse } from '/@/utils/useResponse';
 import { useTemplateRef } from 'vue';
 import * as api from './api';
-import { useCustomHeight } from '/@/utils/useCustomHeight';
 import DataTable from './component/DataTable.vue';
 import { useTableHeight } from '/@/utils/useTableHeight';
-import { getCostOptions } from './api';
+
 
 const titleContainer: Ref<HTMLElement | null> = useTemplateRef('titleContainer');
 const queryContainer: Ref<HTMLElement | null> = useTemplateRef('queryContainer');
@@ -27,9 +24,9 @@ const btnLoading = ref(false);
 const resetLoading = ref(false);
 
 const formInline = reactive<any>({
-	description:'',
-	platform:'',
-	station: '',
+  description: '',
+  platform: '',
+  station: ''
 });
 provide('query-parameter', formInline);
 
@@ -39,65 +36,64 @@ const platformOptions = <any>ref([]);
 provide('stationOptions', stationOptions);
 provide('platformOptions', platformOptions);
 
-
 onBeforeMount(() => {
-	fetchOptions();
+  fetchOptions();
 });
 
 async function fetchOptions() {
-	const resp = (await useResponse(api.getCostOptions)).data;
-	platformOptions.value = resp.platform_list;
-	stationOptions.value= resp.station_list;
+  const resp = (await useResponse(api.getCostOptions)).data;
+  platformOptions.value = resp.platform_list;
+  stationOptions.value = resp.station_list;
 }
 
 async function handleQuery() {
-	btnLoading.value = true;
-	await tableRef.value?.fetchList(true);
-	btnLoading.value = false;
+  btnLoading.value = true;
+  await tableRef.value?.fetchList(true);
+  btnLoading.value = false;
 }
 
 async function resetParameter() {
-	for (const key in formInline) {
-		formInline[key] = '';
-	}
-	resetLoading.value = true;
-	await tableRef.value?.fetchList(true);
-	resetLoading.value = false;
+  for (const key in formInline) {
+    formInline[key] = '';
+  }
+  resetLoading.value = true;
+  await tableRef.value?.fetchList(true);
+  resetLoading.value = false;
 }
 </script>
 
 <template>
-	<div class="p-5">
-		<el-card class="h-full" style="color: rgba(0, 0, 0, 0.88);">
-			<div ref="titleContainer" class="text-xl font-semibold pb-5">成本查看</div>
-			<!-- 查询条件 -->
-			<div ref="queryContainer" class="flex justify-between">
-				<div class="flex flex-1">
-					<div class="w-full whitespace-nowrap">
-						<el-row :gutter="20" style="margin-bottom: 5px;">
-							<el-col :span="5">
-								<div class="flex items-center">
-									<span class="mr-2">SKU</span>
-									<el-input v-model="formInline.description" clearable placeholder="请输入SKU" />
-								</div>
-							</el-col>
-							<el-col :span="5">
-								<div class="flex items-center">
-									<span class="mr-2">平 台</span>
-									<el-select v-model="formInline.platform" placeholder="请选择平台">
-										<el-option v-for="item in platformOptions" :key="item" :label="item" :value="item">
-										</el-option>
-									</el-select>
-								</div>
-							</el-col>
-							<el-col :span="5" class="flex">
-								<div class="flex items-center">
-									<span class="mr-2">地 区</span>
-									<el-select v-model="formInline.station" clearable placeholder="请输入店铺">
+  <div class="p-5">
+    <el-card class="h-full" style="color: rgba(0, 0, 0, 0.88);">
+      <div ref="titleContainer" class="text-xl font-semibold pb-5">成本查看</div>
+      <!-- 查询条件 -->
+      <div ref="queryContainer" class="flex justify-between">
+        <div class="flex flex-1">
+          <div class="w-full whitespace-nowrap">
+            <el-row :gutter="20" style="margin-bottom: 5px;">
+              <el-col :span="5">
+                <div class="flex items-center">
+                  <span class="mr-2">SKU</span>
+                  <el-input v-model="formInline.description" clearable placeholder="请输入SKU" />
+                </div>
+              </el-col>
+              <el-col :span="5">
+                <div class="flex items-center">
+                  <span class="mr-2">平 台</span>
+                  <el-select v-model="formInline.platform" placeholder="请选择平台">
+                    <el-option v-for="item in platformOptions" :key="item" :label="item" :value="item">
+                    </el-option>
+                  </el-select>
+                </div>
+              </el-col>
+              <el-col :span="5" class="flex">
+                <div class="flex items-center">
+                  <span class="mr-2">地 区</span>
+                  <el-select v-model="formInline.station" clearable placeholder="请输入店铺">
                     <el-option></el-option>
                   </el-select>
-								</div>
-							</el-col>
+                </div>
+              </el-col>
               <el-col :span="5">
                 <div class="flex items-center">
                   <span class="mr-2">销售模式</span>
@@ -106,26 +102,26 @@ async function resetParameter() {
                   </el-select>
                 </div>
               </el-col>
-						</el-row>
-					</div>
-				</div>
-				<VerticalDivider />
-				<div class="flex gap-1.5 ml-5">
-					<el-button :icon="Search" :loading="btnLoading" type="primary" @click="handleQuery">
-						查 询
-					</el-button>
-					<el-button :icon="RefreshLeft" :loading="resetLoading" color="#ECECF1C9" style="width: 88px; color: #3c3c3c;"
-										 @click="resetParameter">
-						重 置
-					</el-button>
-				</div>
-			</div>
-			<el-divider ref="dividerContainer" style="margin: 20px 0 12px 0;" />
-			<div :style="{ height: tableHeight + 'px' }">
-				<DataTable ref="table" />
-			</div>
-		</el-card>
-	</div>
+            </el-row>
+          </div>
+        </div>
+        <VerticalDivider />
+        <div class="flex gap-1.5 ml-5">
+          <el-button :icon="Search" :loading="btnLoading" type="primary" @click="handleQuery">
+            查 询
+          </el-button>
+          <el-button :icon="RefreshLeft" :loading="resetLoading" color="#ECECF1C9" style="width: 88px; color: #3c3c3c;"
+                     @click="resetParameter">
+            重 置
+          </el-button>
+        </div>
+      </div>
+      <el-divider ref="dividerContainer" style="margin: 20px 0 12px 0;" />
+      <div :style="{ height: tableHeight + 'px' }">
+        <DataTable ref="table" />
+      </div>
+    </el-card>
+  </div>
 </template>
 
 <style scoped>

+ 2 - 1
src/views/price-approval/direct-sales/component/DataTable.vue

@@ -24,6 +24,7 @@ import {
 	SupplyCheckColumns,
 	SupplyCheckColumns_Regular,
 } from '/@/views/price-approval/Columns';
+import router from '/@/router';
 
 
 interface Parameter {
@@ -158,7 +159,7 @@ function selectAllChangeEvent({ checked }: any) {
 }
 
 function handleCreate() {
-
+  router.push({ name: 'SupplyAddPage', query: { type: 'direct' } });
 }
 
 function handleEdit(row: any) {