|
@@ -7,11 +7,16 @@
|
|
|
|
|
|
import { FormInstance, FormRules } from 'element-plus';
|
|
import { FormInstance, FormRules } from 'element-plus';
|
|
import { Finished, RefreshLeft, Select } from '@element-plus/icons-vue';
|
|
import { Finished, RefreshLeft, Select } from '@element-plus/icons-vue';
|
|
|
|
+import SelectDrawer from './SelectDrawer.vue';
|
|
|
|
|
|
|
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
const routeQuery: any = ref(route.query);
|
|
const routeQuery: any = ref(route.query);
|
|
|
|
|
|
|
|
+const loading = ref(false);
|
|
|
|
+
|
|
|
|
+const isShow = ref(false);
|
|
|
|
+
|
|
interface RuleForm {
|
|
interface RuleForm {
|
|
country: any;
|
|
country: any;
|
|
platform: any;
|
|
platform: any;
|
|
@@ -56,8 +61,6 @@ const rules = reactive<FormRules<RuleForm>>({
|
|
estimated_cost: [ { required: true, message: '请输入预估成本', trigger: 'blur' } ]
|
|
estimated_cost: [ { required: true, message: '请输入预估成本', trigger: 'blur' } ]
|
|
});
|
|
});
|
|
|
|
|
|
-const loading = ref(false);
|
|
|
|
-
|
|
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
const submitForm = async (formEl: FormInstance | undefined) => {
|
|
if (!formEl) return;
|
|
if (!formEl) return;
|
|
await formEl.validate((valid, fields) => {
|
|
await formEl.validate((valid, fields) => {
|
|
@@ -73,6 +76,10 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|
if (!formEl) return;
|
|
if (!formEl) return;
|
|
formEl.resetFields();
|
|
formEl.resetFields();
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+function showSelectDrawer() {
|
|
|
|
+ isShow.value = true;
|
|
|
|
+}
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -80,7 +87,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|
<el-card class="h-full" style="color: rgba(0, 0, 0, 0.88);">
|
|
<el-card class="h-full" style="color: rgba(0, 0, 0, 0.88);">
|
|
<template #header>
|
|
<template #header>
|
|
<span class="text-lg">
|
|
<span class="text-lg">
|
|
- 商品添加 -- {{ routeQuery.type === 'supply' ? '供货' : '直销' }}
|
|
|
|
|
|
+ 商品添加 --> {{ routeQuery.type === 'supply' ? '供货' : '直销' }}
|
|
</span>
|
|
</span>
|
|
</template>
|
|
</template>
|
|
<div class="w-full">
|
|
<div class="w-full">
|
|
@@ -147,7 +154,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<el-form-item class="font-medium" label="成 本" prop="cost">
|
|
<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-button :icon="Select" class="w-full" plain type="primary" @click="showSelectDrawer">选 择</el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -215,7 +222,9 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6">
|
|
<el-col :span="6">
|
|
<el-form-item class="font-medium" label="成 本" prop="cost">
|
|
<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-button :icon="Select" class="w-full" plain type="primary" @click="showSelectDrawer">
|
|
|
|
+ 选 择
|
|
|
|
+ </el-button>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-col>
|
|
</el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -228,6 +237,7 @@ const resetForm = (formEl: FormInstance | undefined) => {
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</el-card>
|
|
</el-card>
|
|
|
|
+ <SelectDrawer v-if="isShow" v-model="isShow" :title="routeQuery.type === 'supply' ? '供货' : '直销'" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|