|
@@ -11,283 +11,285 @@ import SelectDrawer from './SelectDrawer.vue';
|
|
|
import { useResponse } from '/@/utils/useResponse';
|
|
|
import * as api from '../api';
|
|
|
|
|
|
-
|
|
|
const route = useRoute();
|
|
|
const routeQuery: any = ref(route.query);
|
|
|
|
|
|
const currencyCodeOptions = ref([]);
|
|
|
+const countryOptions = ref([]);
|
|
|
|
|
|
const loading = ref(false);
|
|
|
|
|
|
const isShow = ref(false);
|
|
|
|
|
|
interface RuleForm {
|
|
|
- country_code: 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;
|
|
|
+ country_code: 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_code: '',
|
|
|
- platform: '',
|
|
|
- sku: '',
|
|
|
- weight: '',
|
|
|
- currency_code: '',
|
|
|
- price_market_ref: '',
|
|
|
- estimated_cost: '',
|
|
|
- final_cost: '',
|
|
|
- price_market: '',
|
|
|
- price_supply: '',
|
|
|
- cost: '',
|
|
|
- price_show: '',
|
|
|
- price_daily: '',
|
|
|
- price_min: ''
|
|
|
+ country_code: '',
|
|
|
+ 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_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' } ]
|
|
|
+ sku: [{ required: true, message: '请输入SKU', trigger: 'blur' }],
|
|
|
+ platform: [{ 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' }],
|
|
|
});
|
|
|
|
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- await formEl.validate(async (valid, fields) => {
|
|
|
- if (valid) {
|
|
|
- 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);
|
|
|
- }
|
|
|
- });
|
|
|
+ if (!formEl) return;
|
|
|
+ await formEl.validate(async (valid, fields) => {
|
|
|
+ if (valid) {
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
const resetForm = (formEl: FormInstance | undefined) => {
|
|
|
- if (!formEl) return;
|
|
|
- formEl.resetFields();
|
|
|
+ if (!formEl) return;
|
|
|
+ formEl.resetFields();
|
|
|
};
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
- fetchCurrencyCodeOptions();
|
|
|
+ fetchCurrencyCodeOptions();
|
|
|
+ fetchCountryOptions();
|
|
|
});
|
|
|
|
|
|
async function fetchCurrencyCodeOptions() {
|
|
|
- const res = await useResponse(api.getCurrencyCodeOptions);
|
|
|
- currencyCodeOptions.value = res.data.currency_code;
|
|
|
+ const res = await useResponse(api.getCurrencyCodeOptions);
|
|
|
+ currencyCodeOptions.value = res.data.currency_code;
|
|
|
+}
|
|
|
+
|
|
|
+async function fetchCountryOptions() {
|
|
|
+ const res = await useResponse(api.getCountryOptions);
|
|
|
+ countryOptions.value = res.data.country_code;
|
|
|
}
|
|
|
|
|
|
function showSelectDrawer() {
|
|
|
- isShow.value = true;
|
|
|
+ isShow.value = true;
|
|
|
}
|
|
|
|
|
|
function getCheckId(id: any) {
|
|
|
- ruleForm.cost = id.value;
|
|
|
+ ruleForm.cost = id.value;
|
|
|
}
|
|
|
-
|
|
|
</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_code">
|
|
|
- <el-input v-model="ruleForm.country_code" 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 v-for="item in currencyCodeOptions" :label="item" :value="item" />
|
|
|
- </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-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-row :gutter="20">
|
|
|
- <el-col :span="6">
|
|
|
- <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">
|
|
|
- <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 v-for="item in currencyCodeOptions" :label="item" :value="item" />
|
|
|
- </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-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>
|
|
|
- </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>
|
|
|
- <SelectDrawer v-if="isShow" v-model="isShow" :title="routeQuery.type === 'supply' ? '供货' : '直销'"
|
|
|
- @sendCheckId="getCheckId" />
|
|
|
- </div>
|
|
|
+ <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_code">
|
|
|
+ <el-select v-model="ruleForm.country_code" placeholder="请选择国家">
|
|
|
+ <el-option v-for="item in countryOptions" :label="item" :value="item"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <!--<el-input v-model="ruleForm.country_code" 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 v-for="item in currencyCodeOptions" :label="item" :value="item" />
|
|
|
+ </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-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-row :gutter="20">
|
|
|
+ <el-col :span="6">
|
|
|
+ <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">
|
|
|
+ <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 v-for="item in currencyCodeOptions" :label="item" :value="item" />
|
|
|
+ </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-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>
|
|
|
+ </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>
|
|
|
+ <SelectDrawer v-if="isShow" v-model="isShow" :title="routeQuery.type === 'supply' ? '供货' : '直销'" @sendCheckId="getCheckId" />
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
-<style scoped>
|
|
|
-
|
|
|
-</style>
|
|
|
+<style scoped></style>
|