2
0

2 Incheckningar 6dd9c53f33 ... 3c682876b1

Upphovsman SHA1 Meddelande Datum
  WanGxC 3c682876b1 feat(price-approval): 新增货币代码获取功能和成本选择功能 5 månader sedan
  WanGxC f0894b3238 feat(price-approval): 添加成本选择添加功能 5 månader sedan

+ 38 - 0
src/views/price-approval/Columns.ts

@@ -41,6 +41,44 @@ export const CostDetailColumns = [
 	{ field: 'operate', fixed: 'right', title: '操 作', align: 'center', width: 90, slots: { default: 'operate' } }
 ];
 
+export const CostSelectColumns = [
+	{ type: 'radio', minWidth: 50, align: 'center' },
+	{ field: 'description', title: '描 述', minWidth: 200, align: 'center', showOverflow: true },
+	{ field: 'station', title: '地 区', minWidth: 100, align: 'center', showOverflow: true },
+	{ field: 'platform', title: '平 台', minWidth: 100, align: 'center', showOverflow: true },
+	// { field: '', title: '货币单位', minWidth: 'auto', align: 'center', showOverflow: true,},
+	{
+		title: '税费成本', align: 'center',
+		children: [
+			{ field: 'export_tax_rate', title: '出口报关费率', minWidth: 'auto', align: 'center', },
+			{ field: 'import_tax_rate', title: '进口关税率', minWidth: 'auto', align: 'center', },
+			{ field: 'VAT_rate', title: 'VAT', minWidth: 'auto', align: 'center', },
+		],
+	},
+	{
+		title: '运输成本', align: 'center',
+		children: [
+			{ field: 'first_cost', title: '头程运输费率', minWidth: 'auto', align: 'center', },
+			{ field: 'forwarding_fee', title: '转发费', minWidth: 'auto', align: 'center', },
+		],
+	},
+	{
+		title: '销售成本', align: 'center',
+		children: [
+			{ field: 'return_or_refurbishment_rates', title: '退货与翻新费', minWidth: 'auto', align: 'center',
+			},
+			{ field: 'advertising_budget_rate', title: '广告预算费率', minWidth: 'auto', align: 'center',
+			},
+			{ field: 'storage_charges_rate', title: '仓储费', minWidth: 'auto', align: 'center',
+			},
+			{ field: 'brokerage_rate', title: '佣金', minWidth: 'auto', align: 'center',
+			},
+		],
+	},
+	{ field: 'price_supply_rate', title: '供货价折算率', minWidth: 'auto', align: 'center',
+		slots: { default: 'price_supply_rate' }},
+];
+
 
 export const SupplyCheckColumns_Regular = [
 	{ type: 'seq', title: '序 号', width: 50, align: 'center' },

+ 42 - 0
src/views/price-approval/api.ts

@@ -0,0 +1,42 @@
+import { request } from '/@/utils/service';
+
+
+const prefix = '/api/pricing/price_cost/';
+export function getTableData(query: any) {
+  return request({
+    url: prefix,
+    method: 'GET',
+    params: query
+  });
+}
+
+export function getCostOptions(query: any) {
+  return request({
+    url: prefix+ 'box/',
+    method: 'GET',
+    params: query
+  });
+}
+
+export function getCurrencyCodeOptions() {
+  return request({
+    url: prefix + 'currency_code/',
+    method: 'GET',
+  });
+}
+
+export function postSupplyCreate(body: any) {
+  return request({
+    url: '/api/pricing/price_product_supply/',
+    method: 'POST',
+    data: body
+  });
+}
+
+export function postDirectCreate(body: any) {
+  return request({
+    url: '/api/pricing/price_product_direct/',
+    method: 'POST',
+    data: body
+  });
+}

+ 1 - 1
src/views/price-approval/approval-review-supply/api.ts

@@ -1,6 +1,6 @@
 import { request } from '/@/utils/service';
 
-const apiPrefix = '/api/pricing/price_cost/';
+const apiPrefix = '/api/pricing/price_product_supply/';
 
 export function getTableData(query: any) {
 	return request({

+ 43 - 47
src/views/price-approval/approval-review-supply/components/DataTable.vue

@@ -10,8 +10,6 @@ import { ElMessage } from 'element-plus';
 import { usePagination } from '/@/utils/usePagination';
 import { useTableData } from '/@/utils/useTableData';
 import DataTableSlot from './DataTableSlot.vue';
-import { downloadFile } from '/@/utils/service';
-import { uesDownloadFile } from '/@/utils/useDownload';
 import PermissionButton from '/src/components/PermissionButton/index.vue';
 import ImportButton from '/src/components/ImportButton/index.vue';
 import VerticalDivider from '/src/components/VerticalDivider/index.vue';
@@ -25,9 +23,9 @@ import { CostDetailColumns, SupplyCheckColumns_Regular } from '/@/views/price-ap
 const router = useRouter();
 
 interface Parameter {
-	description: string;
-	platform: string;
-	station: string;
+  description: string;
+  platform: string;
+  station: string;
 }
 
 const queryParameter: Parameter | undefined = inject('query-parameter');
@@ -87,19 +85,17 @@ onMounted(() => {
 });
 
 async function fetchList(isQuery = false) {
-	if (isQuery) {
-		gridOptions.pagerConfig.page = 1;
-	}
-
-	gridOptions.data = [];
-	gridOptions.columns = [];
+  if (isQuery) {
+    gridOptions.pagerConfig.page = 1;
+  }
 
-	const query = {
+  gridOptions.data = [];
+  gridOptions.columns = [];
 
-	};
+  const query = {};
 
   await useTableData(api.getTableData, query, gridOptions);
-  await gridRef.value.loadColumn(SupplyCheckColumns_Regular);
+  if (gridOptions && gridOptions.data?.length) await gridRef.value.loadColumn(SupplyCheckColumns_Regular);
   gridOptions.showHeader = Boolean(gridOptions.data?.length);
 }
 
@@ -154,49 +150,49 @@ function selectAllChangeEvent({ checked }: any) {
 }
 
 function handleCreate() {
-  router.push({ name: 'AddPage', query: { type: 'supply' } });
+  router.push({ path: '/addPage', 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 });
@@ -285,12 +281,12 @@ defineExpose({ fetchList });
 
 <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>

+ 40 - 39
src/views/price-approval/approval-review-supply/components/DataTableSlot.vue

@@ -1,4 +1,4 @@
-<script setup lang="ts">
+<script lang="ts" setup>
 /**
  * @Name: DataTableSlot.vue
  * @Description:
@@ -6,62 +6,63 @@
  */
 
 import { hasPermission } from '/@/utils/hasPermission';
-import { Delete, InfoFilled, Key, Operation, View } from '@element-plus/icons-vue';
+import { Delete, InfoFilled, Operation } from '@element-plus/icons-vue';
 import PermissionButton from '/@/components/PermissionButton/index.vue';
 
+
 const props = defineProps<{
-	row: any;
-	field: any;
+  row: any;
+  field: any;
 }>();
 const { row, field } = props;
 
 const emit = defineEmits([ 'edit-row', 'handle-delete', 'handle-manage', 'show-detail' ]);
 
 function handleEdit() {
-	emit('edit-row', row);
+  emit('edit-row', row);
 }
 
 function onConfirm() {
-	emit('handle-delete', row);
+  emit('handle-delete', row);
 }
 
 </script>
 
 <template>
-	<div class="font-medium">
-		<div v-if="field === 'operate'">
-			<div class="flex justify-center gap-2">
-				<div v-if="hasPermission('SkuAttrUpdate')">
-					<PermissionButton circle plain type="warning" @click="handleEdit">
-						<el-icon>
-							<Operation />
-						</el-icon>
-					</PermissionButton>
-				</div>
-				<div v-if="hasPermission('SkuAttrDelete')">
-					<el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220"
-												 @confirm="onConfirm">
-						<template #reference>
-							<PermissionButton circle plain type="danger">
-								<el-icon>
-									<Delete />
-								</el-icon>
-							</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>
-		</div>
-		<div v-else>
-			{{ row[field] || '-' }}
-		</div>
-	</div>
+  <div class="font-medium">
+    <div v-if="field === 'operate'">
+      <div class="flex justify-center gap-2">
+        <div v-if="hasPermission('SkuAttrUpdate')">
+          <PermissionButton circle plain type="warning" @click="handleEdit">
+            <el-icon>
+              <Operation />
+            </el-icon>
+          </PermissionButton>
+        </div>
+        <div v-if="hasPermission('SkuAttrDelete')">
+          <el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220"
+                         @confirm="onConfirm">
+            <template #reference>
+              <PermissionButton circle plain type="danger">
+                <el-icon>
+                  <Delete />
+                </el-icon>
+              </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>
+    </div>
+    <div v-else>
+      {{ row[field] || '-' }}
+    </div>
+  </div>
 </template>
 
 <style scoped>
 
-</style>
+</style>

+ 68 - 20
src/views/price-approval/components/AddPage.vue

@@ -6,19 +6,24 @@
  */
 
 import { FormInstance, FormRules } from 'element-plus';
-import { Finished, RefreshLeft, Select } from '@element-plus/icons-vue';
+import { CirclePlusFilled, Finished, RefreshLeft, Select } from '@element-plus/icons-vue';
 import SelectDrawer from './SelectDrawer.vue';
+import { useResponse } from '/@/utils/useResponse';
+import * as api from '../api';
+import { getCurrencyCodeOptions, postDirectCreate } from '../api';
 
 
 const route = useRoute();
 const routeQuery: any = ref(route.query);
 
+const currencyCodeOptions = ref([]);
+
 const loading = ref(false);
 
 const isShow = ref(false);
 
 interface RuleForm {
-  country: any;
+  country_code: any;
   platform: any;
   sku: any;
   weight: any;
@@ -36,7 +41,7 @@ interface RuleForm {
 
 const ruleFormRef = ref<FormInstance>();
 const ruleForm = reactive<RuleForm>({
-  country: '',
+  country_code: '',
   platform: '',
   sku: '',
   weight: '',
@@ -55,7 +60,7 @@ const ruleForm = reactive<RuleForm>({
 const rules = reactive<FormRules<RuleForm>>({
   sku: [ { required: true, message: '请输入SKU', trigger: 'blur' } ],
   platform: [ { required: true, message: '请输入平台', trigger: 'blur' } ],
-  country: [ { required: true, message: '请输入国家', trigger: 'blur' } ],
+  country_code: [ { 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' } ]
@@ -63,9 +68,13 @@ const rules = reactive<FormRules<RuleForm>>({
 
 const submitForm = async (formEl: FormInstance | undefined) => {
   if (!formEl) return;
-  await formEl.validate((valid, fields) => {
+  await formEl.validate(async (valid, fields) => {
     if (valid) {
-      console.log('submit!');
+      const res = await useResponse(routeQuery.type === 'supply' ? api.postSupplyCreate : api.postDirectCreate, ruleForm, loading);
+      if (res.code === 2000) {
+        ElMessage.success({ message: res.msg, plain: true, icon: CirclePlusFilled });
+        resetForm(formEl);
+      }
     } else {
       console.log('error submit!', fields);
     }
@@ -77,9 +86,23 @@ const resetForm = (formEl: FormInstance | undefined) => {
   formEl.resetFields();
 };
 
+onBeforeMount(() => {
+  fetchCurrencyCodeOptions();
+});
+
+async function fetchCurrencyCodeOptions() {
+  const res = await useResponse(api.getCurrencyCodeOptions);
+  currencyCodeOptions.value = res.data.currency_code;
+}
+
 function showSelectDrawer() {
   isShow.value = true;
 }
+
+function getCheckId(id: any) {
+  ruleForm.cost = id.value;
+}
+
 </script>
 
 <template>
@@ -93,12 +116,11 @@ function showSelectDrawer() {
       <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>
+                 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 class="font-medium" label="国 家" prop="country_code">
+                <el-input v-model="ruleForm.country_code" placeholder="请输入国家" />
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -121,7 +143,7 @@ function showSelectDrawer() {
             <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-option v-for="item in currencyCodeOptions" :label="item" :value="item" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -154,19 +176,32 @@ function showSelectDrawer() {
             </el-col>
             <el-col :span="6">
               <el-form-item class="font-medium" label="成 本" prop="cost">
-                <el-button :icon="Select" class="w-full" plain type="primary" @click="showSelectDrawer">选 择</el-button>
+                <el-button v-if="!ruleForm.cost" :icon="Select" class="w-full" plain type="primary" @click="showSelectDrawer">
+                  选 择
+                </el-button>
+                <div v-else class="flex flex-1">
+                  <el-input v-model="ruleForm.cost" :disabled="true">
+                    <template #prepend>
+                      <i class="bi bi-cash-coin" style="color: #67C23A; font-size: 20px;"></i>
+                    </template>
+                    <template #append>
+                      <el-button style="color: #E6A23C" @click="showSelectDrawer">
+                        重新选择
+                      </el-button>
+                    </template>
+                  </el-input>
+                </div>
               </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-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 class="font-medium" label="国 家" prop="country_code">
+                <el-input v-model="ruleForm.country_code" placeholder="请输入国家" />
               </el-form-item>
             </el-col>
             <el-col :span="6">
@@ -189,7 +224,7 @@ function showSelectDrawer() {
             <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-option v-for="item in currencyCodeOptions" :label="item" :value="item" />
                 </el-select>
               </el-form-item>
             </el-col>
@@ -222,9 +257,21 @@ function showSelectDrawer() {
             </el-col>
             <el-col :span="6">
               <el-form-item class="font-medium" label="成 本" prop="cost">
-                <el-button :icon="Select" class="w-full" plain type="primary" @click="showSelectDrawer">
+                <el-button v-if="!ruleForm.cost" :icon="Select" class="w-full" plain type="primary" @click="showSelectDrawer">
                   选 择
                 </el-button>
+                <div v-else class="flex flex-1">
+                  <el-input v-model="ruleForm.cost" :disabled="true">
+                    <template #prepend>
+                      <i class="bi bi-cash-coin" style="color: #67C23A"></i>
+                    </template>
+                    <template #append>
+                      <el-button style="color: #E6A23C" @click="showSelectDrawer">
+                        重新选择
+                      </el-button>
+                    </template>
+                  </el-input>
+                </div>
               </el-form-item>
             </el-col>
           </el-row>
@@ -237,7 +284,8 @@ function showSelectDrawer() {
         </div>
       </template>
     </el-card>
-    <SelectDrawer v-if="isShow" v-model="isShow" :title="routeQuery.type === 'supply' ? '供货' : '直销'" />
+    <SelectDrawer v-if="isShow" v-model="isShow" :title="routeQuery.type === 'supply' ? '供货' : '直销'"
+                  @sendCheckId="getCheckId" />
   </div>
 </template>
 

+ 56 - 18
src/views/price-approval/components/SelectDrawer.vue

@@ -1,4 +1,5 @@
-<script lang="ts" setup>/**
+<script lang="ts" setup>
+/**
  * @Name: SelectDrawer.vue
  * @Description: 成本选择抽屉
  * @Author: Cheney
@@ -6,13 +7,14 @@
 
 import { hasPermission } from '/@/utils/hasPermission';
 import { Plus, Refresh } from '@element-plus/icons-vue';
-import { CompetitorMonitorCommentColumns } from '/@/views/product-manage/Columns';
 import VerticalDivider from '/@/components/VerticalDivider/index.vue';
 import PermissionButton from '/@/components/PermissionButton/index.vue';
-import DataTableSlot from '/@/views/product-manage/comment-detail/component/DataTableSlot.vue';
 import { usePagination } from '/@/utils/usePagination';
 import { useTableData } from '/@/utils/useTableData';
-import * as api from '/@/views/product-manage/comment-detail/api';
+import * as api from '../api';
+import { CostSelectColumns } from '/@/views/price-approval/Columns';
+import { useResponse } from '/@/utils/useResponse';
+import CreateDialog from '/@/views/price-approval/cost-detail/component/CreateDialog.vue';
 
 
 const isShow = defineModel({ default: false });
@@ -23,12 +25,22 @@ const props = defineProps({
 });
 const { rowData, title } = props;
 
+const emit = defineEmits(['sendCheckId']);
+
+const editDrawer = ref();
+
 const queryRow = reactive<any>({});
 
 const platformOptions = ref([]);
+const stationOptions = ref([]);
+provide('stationOptions', stationOptions);
+
+const createOpen = ref(false);
 
 const { tableOptions, handlePageChange } = usePagination(fetchList);
 
+const checkedId = ref(null);
+
 const gridRef = ref();
 const gridOptions: any = reactive({
   size: 'mini',
@@ -48,6 +60,9 @@ const gridOptions: any = reactive({
   rowConfig: {
     isHover: true
   },
+  radioConfig: {
+    strict: false
+  },
   pagerConfig: {
     total: tableOptions.value.total,
     page: tableOptions.value.page,
@@ -62,6 +77,11 @@ const gridOptions: any = reactive({
   data: ''
 });
 
+onBeforeMount(() => {
+  fetchList();
+  fetchOptions();
+});
+
 async function fetchList(isQuery = false) {
   if (isQuery) {
     gridOptions.pagerConfig.page = 1;
@@ -71,13 +91,13 @@ async function fetchList(isQuery = false) {
   gridOptions.columns = [];
 
   const query = {
-    // asin: asin,
-    // country_code: formInline?.country,
-    // score: formInline?.score,
-    // tiv: formInline?.tiv,
+    description: queryRow?.description,
+    platform: queryRow?.platform,
+    station: queryRow?.station
   };
+
   await useTableData(api.getTableData, query, gridOptions);
-  await gridRef.value.loadColumn(CompetitorMonitorCommentColumns);
+  if (gridOptions && gridOptions.data?.length) await gridRef.value.loadColumn(CostSelectColumns);
   gridOptions.showHeader = Boolean(gridOptions.data?.length);
 }
 
@@ -86,8 +106,25 @@ function handleRefresh() {
 }
 
 function handleCreate() {
+  createOpen.value = true;
+}
 
+async function fetchOptions() {
+  const resp = (await useResponse(api.getCostOptions)).data;
+  platformOptions.value = resp.platform_list;
+  stationOptions.value = resp.station_list;
 }
+
+function radioChangeEvent({ row }: any) {
+  checkedId.value = row.id;
+  if (checkedId.value) {
+    emit('sendCheckId', checkedId);
+    editDrawer.value.handleClose();
+  }
+}
+
+defineExpose({ editDrawer });
+
 </script>
 
 <template>
@@ -103,28 +140,29 @@ function handleCreate() {
         style="background-color:#F3F4FB;">
       <div class="px-5 mb-5">
         <el-card class="border-none mt-2">
+          <!-- 查询条件 -->
           <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">描 述</span>
-                    <el-input v-model="queryRow.description" clearable placeholder="请输入描述" />
+                    <el-input v-model="queryRow.description" clearable placeholder="请输入描述" @change="fetchList(true)" />
                   </div>
                 </el-col>
                 <el-col :span="4" class="flex">
                   <div class="flex items-center">
                     <span class="mr-2">地 区</span>
-                    <el-select v-model="queryRow.station" clearable placeholder="请选择地区">
-                      <el-option></el-option>
+                    <el-select v-model="queryRow.station" clearable placeholder="请选择地区" @change="fetchList(true)">
+                      <el-option v-for="item in stationOptions" :key="item" :label="item" :value="item" />
                     </el-select>
                   </div>
                 </el-col>
                 <el-col :span="4">
                   <div class="flex items-center">
                     <span class="mr-2">平 台</span>
-                    <el-select v-model="queryRow.platform" placeholder="请选择平台">
-                      <el-option v-for="item in platformOptions" :key="item" :label="item" :value="item"></el-option>
+                    <el-select v-model="queryRow.platform" placeholder="请选择平台" @change="fetchList(true)">
+                      <el-option v-for="item in platformOptions" :key="item" :label="item" :value="item" />
                     </el-select>
                   </div>
                 </el-col>
@@ -132,7 +170,7 @@ function handleCreate() {
             </div>
           </div>
           <el-divider />
-          <vxe-grid ref="gridRef" class="z-0" v-bind="gridOptions">
+          <vxe-grid ref="gridRef" class="z-0" v-bind="gridOptions" @radio-change="radioChangeEvent">
             <template #toolbar_buttons>
               <div class="flex gap-2">
                 <PermissionButton v-if="hasPermission('ReviewCreate')" :icon="Plus" plain round type="primary"
@@ -164,14 +202,14 @@ function handleCreate() {
             <template #empty>
               <el-empty description="暂无数据" />
             </template>
-            <!-- 自定义列插槽 -->
-            <template v-for="col in CompetitorMonitorCommentColumns" #[`${col.field}`]="{ row }">
-              <DataTableSlot :key="row.id" :field="col.field" :row="row" />
+            <!-- TODO: 供货价折算率 -->
+            <template #price_supply_rate>
             </template>
           </vxe-grid>
         </el-card>
       </div>
     </el-drawer>
+    <CreateDialog v-if="createOpen" v-model="createOpen" @refresh="fetchList" />
   </div>
 </template>
 

+ 1 - 1
src/views/price-approval/cost-detail/component/DataTableSlot.vue

@@ -64,4 +64,4 @@ function onConfirm() {
 
 <style scoped>
 
-</style>
+</style>

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

@@ -18,17 +18,17 @@ import VerticalDivider from '/src/components/VerticalDivider/index.vue';
 import * as api from '../api';
 import { useResponse } from '/@/utils/useResponse';
 import {
-	DirectSalesCheckColumns_Regular, DirectSalesCheckColumns_Special,
+  DirectSalesCheckColumns_Regular, DirectSalesCheckColumns_Special
 } from '/@/views/price-approval/Columns';
 import EditDrawer from '/@/views/price-approval/direct-sales/component/EditDrawer.vue';
 import router from '/@/router';
 
 
 interface Parameter {
-	sku: string;
-	platform: string;
-	country_code: string;
-	sales_mode: string;
+  sku: string;
+  platform: string;
+  country_code: string;
+  sales_mode: string;
 }
 
 const queryParameter: Parameter | undefined = inject('query-parameter');
@@ -36,37 +36,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());
@@ -80,194 +80,194 @@ 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;
-	}
+  if (isQuery) {
+    gridOptions.pagerConfig.page = 1;
+  }
 
-	gridOptions.data = [];
-	gridOptions.columns = [];
+  gridOptions.data = [];
+  gridOptions.columns = [];
 
-	const query = {
-		sku: queryParameter?.sku,
-		platform: queryParameter?.platform,
-		country_code:queryParameter?.country_code,
-		sales_mode: queryParameter?.sales_mode,
-	};
+  const query = {
+    sku: queryParameter?.sku,
+    platform: queryParameter?.platform,
+    country_code: queryParameter?.country_code,
+    sales_mode: queryParameter?.sales_mode
+  };
 
-	await useTableData(api.getTableData, query, gridOptions);
-	await gridRef.value.loadColumn(DirectSalesCheckColumns_Special);
-	gridOptions.showHeader = Boolean(gridOptions.data?.length);
+  await useTableData(api.getTableData, query, gridOptions);
+  if (gridOptions && gridOptions.data?.length) await gridRef.value.loadColumn(DirectSalesCheckColumns_Special);
+  gridOptions.showHeader = Boolean(gridOptions.data?.length);
 }
 
 function handleRefresh() {
-	fetchList();
+  fetchList();
 }
 
 async function handleDownload() {
-	// gridOptions.loading = true;
-	// try {
-	// 	await uesDownloadFile({
-	// 		apiMethod: api.exportData, // 调用的 API 方法
-	// 		queryParams: {
-	// 			sku: queryParameter?.sku,
-	// 			platform: queryParameter?.platform,
-	// 			country_code:queryParameter?.country_code,
-	// 			sales_mode: queryParameter?.sales_mode,
-	// 		},
-	// 		fileName: '审批查看(直销)数据.xlsx', // 自定义文件名
-	// 		successMessage: () => ElMessage.success('数据导出成功!'),
-	// 		errorMessage: () => ElMessage.error('数据导出失败,请重试!'),
-	// 	});
-	// } finally {
-	// 	gridOptions.loading = false; // 结束加载状态
-	// }
+  // gridOptions.loading = true;
+  // try {
+  // 	await uesDownloadFile({
+  // 		apiMethod: api.exportData, // 调用的 API 方法
+  // 		queryParams: {
+  // 			sku: queryParameter?.sku,
+  // 			platform: queryParameter?.platform,
+  // 			country_code:queryParameter?.country_code,
+  // 			sales_mode: queryParameter?.sales_mode,
+  // 		},
+  // 		fileName: '审批查看(直销)数据.xlsx', // 自定义文件名
+  // 		successMessage: () => ElMessage.success('数据导出成功!'),
+  // 		errorMessage: () => ElMessage.error('数据导出失败,请重试!'),
+  // 	});
+  // } finally {
+  // 	gridOptions.loading = false; // 结束加载状态
+  // }
 }
 
 function handleCreate() {
-  router.push({ name: 'AddPage', query: { type: 'direct' } });
+  router.push({ path: '/addPage', query: { type: 'direct' } });
 }
 
 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:600,
-	}
+function cellStyle() {
+  return {
+    fontWeight: 600
+  };
 }
 
 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: 200px">
-						<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 DirectSalesCheckColumns_Special" #[`${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" />
+  <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: 200px">
+            <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 DirectSalesCheckColumns_Special" #[`${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" />
 </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>

+ 45 - 44
src/views/price-approval/direct-sales/component/DataTableSlot.vue

@@ -1,4 +1,4 @@
-<script setup lang="ts">
+<script lang="ts" setup>
 /**
  * @Name: DataTableSlot.vue
  * @Description: 审批查看(直接销售)数据表格插槽
@@ -6,13 +6,14 @@
  */
 
 import { hasPermission } from '/@/utils/hasPermission';
-import { Delete, InfoFilled, Key, Operation, View } from '@element-plus/icons-vue';
+import { Delete, InfoFilled, Operation } from '@element-plus/icons-vue';
 import PermissionButton from '/@/components/PermissionButton/index.vue';
 import { useCountryInfoStore } from '/@/stores/countryInfo';
 
+
 const props = defineProps<{
-	row: any;
-	field: any;
+  row: any;
+  field: any;
 }>();
 const { row, field } = props;
 
@@ -23,55 +24,55 @@ const country = countryInfoStore.Countries.find(c => c.code == row.country_code)
 const color = country ? country.color : '#3875F6';
 
 function handleEdit() {
-	emit('edit-row', row);
+  emit('edit-row', row);
 }
 
 function onConfirm() {
-	emit('handle-delete', row);
+  emit('handle-delete', row);
 }
 
 </script>
 
 <template>
-	<div class="font-medium">
-		<div v-if="field === 'operate'">
-			<div class="flex justify-center gap-2">
-				<div v-if="hasPermission('SkuAttrUpdate')">
-					<PermissionButton circle plain type="warning" @click="handleEdit">
-						<el-icon>
-							<Operation />
-						</el-icon>
-					</PermissionButton>
-				</div>
-				<div v-if="hasPermission('SkuAttrDelete')">
-					<el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220"
-												 @confirm="onConfirm">
-						<template #reference>
-							<PermissionButton circle plain type="danger">
-								<el-icon>
-									<Delete />
-								</el-icon>
-							</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>
-		</div>
-		<div v-else-if="field === 'country_code'">
-			<el-tag :disable-transitions="true" :style="{ color: color, borderColor: color }" effect="plain" round>
-				{{ country ? country.name : '-' }}
-			</el-tag>
-		</div>
-		<div v-else>
-			{{ row[field] || '-' }}
-		</div>
-	</div>
+  <div class="font-medium">
+    <div v-if="field === 'operate'">
+      <div class="flex justify-center gap-2">
+        <div v-if="hasPermission('SkuAttrUpdate')">
+          <PermissionButton circle plain type="warning" @click="handleEdit">
+            <el-icon>
+              <Operation />
+            </el-icon>
+          </PermissionButton>
+        </div>
+        <div v-if="hasPermission('SkuAttrDelete')">
+          <el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220"
+                         @confirm="onConfirm">
+            <template #reference>
+              <PermissionButton circle plain type="danger">
+                <el-icon>
+                  <Delete />
+                </el-icon>
+              </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>
+    </div>
+    <div v-else-if="field === 'country_code'">
+      <el-tag :disable-transitions="true" :style="{ color: color, borderColor: color }" effect="plain" round>
+        {{ country ? country.name : '-' }}
+      </el-tag>
+    </div>
+    <div v-else>
+      {{ row[field] || '-' }}
+    </div>
+  </div>
 </template>
 
 <style scoped>
 
-</style>
+</style>

+ 107 - 106
src/views/price-approval/direct-sales/component/EditDrawer.vue

@@ -19,139 +19,140 @@ const editOpen = defineModel({ default: false });
 const editDrawer = <Ref>useTemplateRef('editDrawer');
 
 const props: any = defineProps({
-	rowData: Object,
+  rowData: Object
 });
 const { rowData } = props;
 
-const emit = defineEmits(['refresh']);
+const emit = defineEmits([ 'refresh' ]);
 
 interface RuleForm {
-	sku: string;
-	weight: string;
-	platform: string;
-	country_code:string;
-	currency_code: string;
-	estimated_cost: string;
-	price_show: string;
-	price_daily: string;
-	price_min: string;
-	final_cost: string;
-	sales_mode: string;
-	cost: string;
+  sku: string;
+  weight: string;
+  platform: string;
+  country_code: string;
+  currency_code: string;
+  estimated_cost: string;
+  price_show: string;
+  price_daily: string;
+  price_min: string;
+  final_cost: string;
+  sales_mode: string;
+  cost: string;
 }
 
 const ruleFormRef = ref<FormInstance>();
 const ruleForm = reactive<RuleForm>({
-	sku: rowData.sku,
-	weight: rowData.weight,
-	platform: rowData.platform,
-	country_code:rowData.country_code,
-	currency_code: rowData.currency_code,
-	estimated_cost: rowData.estimated_cost,
-	price_show: rowData.price_show,
-	price_daily: rowData.price_daily,
-	price_min: rowData.price_min,
-	final_cost: rowData.final_cost,
-	sales_mode: rowData.sales_mode,
-	cost: rowData.cost,
+  sku: rowData.sku,
+  weight: rowData.weight,
+  platform: rowData.platform,
+  country_code: rowData.country_code,
+  currency_code: rowData.currency_code,
+  estimated_cost: rowData.estimated_cost,
+  price_show: rowData.price_show,
+  price_daily: rowData.price_daily,
+  price_min: rowData.price_min,
+  final_cost: rowData.final_cost,
+  sales_mode: rowData.sales_mode,
+  cost: rowData.cost
 });
 
 const rules = reactive<FormRules<RuleForm>>({});
 
 const submitForm = async (formEl: FormInstance | undefined) => {
-	if (!formEl) return;
-	await formEl.validate(async (valid, fields) => {
-		if (valid) {
-			try {
-				const res = await useResponse(api.updateRow, { id: rowData?.id, ...ruleForm }, btnLoading);
-				if (res && res.code == 2000) {
-					editOpen.value = false;
-					ElMessage.success({ message: '编辑成功', plain: true, icon: 'Operation' });
-					emit('refresh');
-				}
-			} catch (error) {
-				console.error('Error==>', error);
-			}
-		} else {
-			console.log('error submit!', fields);
-		}
-	});
+  if (!formEl) return;
+  await formEl.validate(async (valid, fields) => {
+    if (valid) {
+      try {
+        const res = await useResponse(api.updateRow, { id: rowData?.id, ...ruleForm }, btnLoading);
+        if (res && res.code == 2000) {
+          editOpen.value = false;
+          ElMessage.success({ message: '编辑成功', plain: true, icon: 'Operation' });
+          emit('refresh');
+        }
+      } catch (error) {
+        console.error('Error==>', error);
+      }
+    } else {
+      console.log('error submit!', fields);
+    }
+  });
 };
 
 function closeDrawer() {
-	editDrawer.value.handleClose();
+  editDrawer.value.handleClose();
 }
 </script>
 
 <template>
-	<div class="drawer-container">
-		<el-drawer
-			ref="editDrawer"
-			v-model="editOpen"
-			:close-on-click-modal="false"
-			:close-on-press-escape="false"
-			:title="`成本查看 - 编辑 `"
-			size="30%"
-		>
-			<el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" class="mx-2.5 mt-7" label-position="top"
-							 label-width="auto" status-icon>
-				<el-form-item class="font-medium" label="SKU" prop="sku">
-					<el-input v-model="ruleForm.sku" placeholder="请输入SKU" />
-				</el-form-item>
-				<el-form-item class="font-medium" label="重量(KG)" prop="weight">
-					<el-input v-model="ruleForm.weight" placeholder="请输入重量"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="平 台" prop="platform">
-					<el-input v-model="ruleForm.platform" placeholder="请输入平台"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="国 家" prop="country_code">
-					<el-select v-model="ruleForm.currency_code" placeholder="请选择货币代码">
-						<el-option v-for="item in countryOptions" :key="item" :label="item" :value="item"></el-option>
-					</el-select>
-				</el-form-item>
-				<el-form-item class="font-medium" label="货币代码" prop="currency_code">
-					<el-input v-model="ruleForm.currency_code" placeholder="请输入货币代码"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="预估硬件成本" prop="estimated_cost">
-					<el-input v-model="ruleForm.estimated_cost" placeholder="请输入预估硬件成本"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="展示价格(外币)" prop="price_show">
-					<el-input v-model="ruleForm.price_show" placeholder="请输入展示价格(外币)"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="日常活动售价(外币)" prop="price_daily">
-					<el-input v-model="ruleForm.price_daily" placeholder="请输入展示价格(外币)"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="最低售价(外币)" prop="price_min">
-					<el-input v-model="ruleForm.price_min" placeholder="请输入最低售价(外币)"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="尾程费用(外币)" prop="final_cost">
-					<el-input v-model="ruleForm.final_cost" placeholder="请输入尾程费用(外币)"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="销售模式" prop="sales_mode">
-					<el-input v-model="ruleForm.sales_mode" placeholder="请输入销售模式"></el-input>
-				</el-form-item>
-				<el-form-item class="font-medium" label="成本" prop="cost">
-					<el-input v-model="ruleForm.cost" placeholder="请输入成本"></el-input>
-				</el-form-item>
-				<el-form-item>
-					<el-divider />
-					<div class="flex flex-1 justify-end">
-						<el-button :icon="Close" @click="closeDrawer">取 消</el-button>
-						<el-button :icon="Finished" :loading="btnLoading" type="primary" @click="submitForm(ruleFormRef)"> 确 定 </el-button>
-					</div>
-				</el-form-item>
-			</el-form>
-		</el-drawer>
-	</div>
+  <div class="drawer-container">
+    <el-drawer
+        ref="editDrawer"
+        v-model="editOpen"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :title="`成本查看 - 编辑 `"
+        size="30%"
+    >
+      <el-form ref="ruleFormRef" :model="ruleForm" :rules="rules" class="mx-2.5 mt-7" label-position="top"
+               label-width="auto" status-icon>
+        <el-form-item class="font-medium" label="SKU" prop="sku">
+          <el-input v-model="ruleForm.sku" placeholder="请输入SKU" />
+        </el-form-item>
+        <el-form-item class="font-medium" label="重量(KG)" prop="weight">
+          <el-input v-model="ruleForm.weight" placeholder="请输入重量"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="平 台" prop="platform">
+          <el-input v-model="ruleForm.platform" placeholder="请输入平台"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="国 家" prop="country_code">
+          <el-select v-model="ruleForm.currency_code" placeholder="请选择货币代码">
+            <el-option v-for="item in countryOptions" :key="item" :label="item" :value="item"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item class="font-medium" label="货币代码" prop="currency_code">
+          <el-input v-model="ruleForm.currency_code" placeholder="请输入货币代码"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="预估硬件成本" prop="estimated_cost">
+          <el-input v-model="ruleForm.estimated_cost" placeholder="请输入预估硬件成本"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="展示价格(外币)" prop="price_show">
+          <el-input v-model="ruleForm.price_show" placeholder="请输入展示价格(外币)"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="日常活动售价(外币)" prop="price_daily">
+          <el-input v-model="ruleForm.price_daily" placeholder="请输入展示价格(外币)"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="最低售价(外币)" prop="price_min">
+          <el-input v-model="ruleForm.price_min" placeholder="请输入最低售价(外币)"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="尾程费用(外币)" prop="final_cost">
+          <el-input v-model="ruleForm.final_cost" placeholder="请输入尾程费用(外币)"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="销售模式" prop="sales_mode">
+          <el-input v-model="ruleForm.sales_mode" placeholder="请输入销售模式"></el-input>
+        </el-form-item>
+        <el-form-item class="font-medium" label="成本" prop="cost">
+          <el-input v-model="ruleForm.cost" placeholder="请输入成本"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-divider />
+          <div class="flex flex-1 justify-end">
+            <el-button :icon="Close" @click="closeDrawer">取 消</el-button>
+            <el-button :icon="Finished" :loading="btnLoading" type="primary" @click="submitForm(ruleFormRef)"> 确 定
+            </el-button>
+          </div>
+        </el-form-item>
+      </el-form>
+    </el-drawer>
+  </div>
 </template>
 
 <style scoped>
 .drawer-container :deep(.el-drawer__header) {
-	border-bottom: none;
-	font-weight: 500;
+  border-bottom: none;
+  font-weight: 500;
 }
 
 .drawer-container :deep(.el-drawer__title) {
-	font-size: 18px;
+  font-size: 18px;
 }
 </style>