Compare commits
No commits in common. "f72430d42e30063c92a597e3a0c02711f7dc17df" and "fdd85196e8148de2470c220ceb23f0781eed1989" have entirely different histories.
f72430d42e
...
fdd85196e8
|
Before Width: | Height: | Size: 923 KiB |
|
Before Width: | Height: | Size: 619 KiB |
|
Before Width: | Height: | Size: 237 KiB |
|
Before Width: | Height: | Size: 477 KiB |
|
Before Width: | Height: | Size: 619 KiB |
|
Before Width: | Height: | Size: 237 KiB |
|
Before Width: | Height: | Size: 477 KiB |
|
|
@ -1,114 +0,0 @@
|
||||||
<template>
|
|
||||||
<el-dialog
|
|
||||||
v-model="dialogVisible"
|
|
||||||
title="车型信息"
|
|
||||||
width="800px"
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
:modal-append-to-body="false"
|
|
||||||
>
|
|
||||||
<div class="car-model-info">
|
|
||||||
<div class="info-content">
|
|
||||||
<div class="text-info">
|
|
||||||
<h3>{{ carModel.name }}</h3>
|
|
||||||
<p class="description">{{ carModel.description }}</p>
|
|
||||||
<div class="specs">
|
|
||||||
<div class="spec-item" v-for="(spec, key) in carModel.specifications" :key="key">
|
|
||||||
<span class="label">{{ key }}:</span>
|
|
||||||
<span class="value">{{ spec }}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="image-info">
|
|
||||||
<img :src="carModel.image" :alt="carModel.name" class="car-image" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button @click="closeDialog">关闭</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup>
|
|
||||||
import { ref, defineProps, defineEmits } from 'vue';
|
|
||||||
|
|
||||||
const props = defineProps({
|
|
||||||
modelValue: Boolean,
|
|
||||||
carModel: {
|
|
||||||
type: Object,
|
|
||||||
required: true
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue']);
|
|
||||||
|
|
||||||
const dialogVisible = computed({
|
|
||||||
get: () => props.modelValue,
|
|
||||||
set: (val) => emit('update:modelValue', val)
|
|
||||||
});
|
|
||||||
|
|
||||||
const closeDialog = () => {
|
|
||||||
dialogVisible.value = false;
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.car-model-info {
|
|
||||||
padding: 20px;
|
|
||||||
|
|
||||||
.info-content {
|
|
||||||
display: flex;
|
|
||||||
gap: 30px;
|
|
||||||
|
|
||||||
.text-info {
|
|
||||||
flex: 1;
|
|
||||||
|
|
||||||
h3 {
|
|
||||||
margin: 0 0 15px 0;
|
|
||||||
font-size: 20px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.description {
|
|
||||||
color: #666;
|
|
||||||
line-height: 1.6;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.specs {
|
|
||||||
.spec-item {
|
|
||||||
margin-bottom: 10px;
|
|
||||||
|
|
||||||
.label {
|
|
||||||
font-weight: bold;
|
|
||||||
margin-right: 10px;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
|
|
||||||
.value {
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-info {
|
|
||||||
width: 400px;
|
|
||||||
|
|
||||||
.car-image {
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
border-radius: 8px;
|
|
||||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.dialog-footer {
|
|
||||||
text-align: right;
|
|
||||||
padding-top: 20px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
@ -20,77 +20,19 @@ export const customerOptions = {
|
||||||
|
|
||||||
export const carTypeOptions = [
|
export const carTypeOptions = [
|
||||||
{
|
{
|
||||||
label: "最常选择",
|
label: "最近常选",
|
||||||
options: [
|
options: [
|
||||||
{
|
{ label: "CR400AF", value: "CR400AF" },
|
||||||
value: "CR400AF",
|
],
|
||||||
label: "CR400AF",
|
|
||||||
description: "中国标准动车组,最高运营速度350km/h",
|
|
||||||
specifications: {
|
|
||||||
"最高运营速度": "350km/h",
|
|
||||||
"编组方式": "8辆编组",
|
|
||||||
"定员": "556人",
|
|
||||||
"轴重": "≤17t"
|
|
||||||
},
|
|
||||||
image: "/images/cars/CR400AF.jpg"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "高速动车组",
|
label: "全部车型",
|
||||||
options: [
|
options: [
|
||||||
{
|
{ label: "CR400AF", value: "CR400AF" },
|
||||||
value: "CR400AF",
|
{ label: "JR800AF", value: "JR800AF" },
|
||||||
label: "CR400AF",
|
{ label: "其他", value: "其他" },
|
||||||
description: "中国标准动车组,最高运营速度350km/h",
|
],
|
||||||
specifications: {
|
|
||||||
"最高运营速度": "350km/h",
|
|
||||||
"编组方式": "8辆编组",
|
|
||||||
"定员": "556人",
|
|
||||||
"轴重": "≤17t"
|
|
||||||
},
|
},
|
||||||
image: "/images/cars/CR400AF.jpg"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "CR400BF",
|
|
||||||
label: "CR400BF",
|
|
||||||
description: "中国标准动车组,最高运营速度350km/h",
|
|
||||||
specifications: {
|
|
||||||
"最高运营速度": "350km/h",
|
|
||||||
"编组方式": "8辆编组",
|
|
||||||
"定员": "556人",
|
|
||||||
"轴重": "≤17t"
|
|
||||||
},
|
|
||||||
image: "/images/cars/CR400BF.jpg"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "城际动车组",
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
value: "CRH3A",
|
|
||||||
label: "CRH3A",
|
|
||||||
description: "城际动车组,最高运营速度250km/h",
|
|
||||||
specifications: {
|
|
||||||
"最高运营速度": "250km/h",
|
|
||||||
"编组方式": "8辆编组",
|
|
||||||
"定员": "613人",
|
|
||||||
"轴重": "≤16t"
|
|
||||||
},
|
|
||||||
image: "/images/cars/CRH3A.jpg"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: "其他",
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
value: "其他",
|
|
||||||
label: "其他"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
export const treeData = [
|
export const treeData = [
|
||||||
|
|
|
||||||
|
|
@ -2,20 +2,27 @@
|
||||||
<div class="step2-container">
|
<div class="step2-container">
|
||||||
<div class="main-row">
|
<div class="main-row">
|
||||||
<div class="step-indicator">
|
<div class="step-indicator">
|
||||||
<div :class="['circle', currentStep === 1 ? 'active' : '']">1</div>
|
<div
|
||||||
|
:class="['circle', selectedCarTypeProxy === '其他' ? 'active' : '']"
|
||||||
|
>
|
||||||
|
1
|
||||||
|
</div>
|
||||||
<div class="line"></div>
|
<div class="line"></div>
|
||||||
<div :class="['circle', currentStep === 2 ? 'active' : '']">2</div>
|
<div
|
||||||
|
:class="['circle', selectedCarTypeProxy !== '其他' ? 'active' : '']"
|
||||||
|
>
|
||||||
|
2
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="right-content">
|
<div class="right-content">
|
||||||
<div v-if="currentStep === 1">
|
<div v-if="selectedCarTypeProxy === '其他'">
|
||||||
<div class="step-title">第一步:选择车型</div>
|
<div class="step-title">第一步:选择车型</div>
|
||||||
<el-form label-width="120px" class="model-form">
|
<el-form label-width="120px" class="model-form">
|
||||||
<el-form-item label="车型列表" required>
|
<el-form-item label="可参考车型列表" required>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="selectedCarTypeProxy"
|
v-model="selectedCarTypeProxy"
|
||||||
placeholder="请选择车型"
|
placeholder="请选择车型"
|
||||||
filterable
|
filterable
|
||||||
@change="handleCarTypeChange"
|
|
||||||
>
|
>
|
||||||
<el-option-group
|
<el-option-group
|
||||||
v-for="group in carTypeOptions"
|
v-for="group in carTypeOptions"
|
||||||
|
|
@ -31,47 +38,8 @@
|
||||||
</el-option-group>
|
</el-option-group>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="计划购买数量" required>
|
<el-form-item label="计划购买数量">
|
||||||
<el-input-number v-model="planCount" :min="1" :max="999" />
|
<el-input v-model="planCount" placeholder="请输入计划购买数量" />
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="计划交付时间" required>
|
|
||||||
<el-date-picker
|
|
||||||
v-model="deliveryTime"
|
|
||||||
type="date"
|
|
||||||
placeholder="选择日期"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="计划交付方式" required>
|
|
||||||
<el-radio-group v-model="deliveryMethod">
|
|
||||||
<el-radio label="self">自行提货</el-radio>
|
|
||||||
<el-radio label="logistics">物流配送</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<!-- 其他车型的额外表单 -->
|
|
||||||
<template v-if="selectedCarTypeProxy === '其他'">
|
|
||||||
<el-form-item label="可参考车型列表">
|
|
||||||
<el-select
|
|
||||||
v-model="referenceCarType"
|
|
||||||
placeholder="请选择参考车型"
|
|
||||||
filterable
|
|
||||||
@change="handleReferenceCarTypeChange"
|
|
||||||
>
|
|
||||||
<el-option-group
|
|
||||||
v-for="group in referenceCarTypeOptions"
|
|
||||||
:key="group.label"
|
|
||||||
:label="group.label"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="option in group.options"
|
|
||||||
:key="option.value"
|
|
||||||
:label="option.label"
|
|
||||||
:value="option.value"
|
|
||||||
/>
|
|
||||||
</el-option-group>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="车型输入">
|
<el-form-item label="车型输入">
|
||||||
<el-input v-model="modelInput" placeholder="请输入车型" />
|
<el-input v-model="modelInput" placeholder="请输入车型" />
|
||||||
|
|
@ -84,38 +52,41 @@
|
||||||
placeholder="请输入车型描述"
|
placeholder="请输入车型描述"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</template>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="step">
|
<div class="step">
|
||||||
<div class="step-left">
|
<div class="step-left">
|
||||||
<div class="step-title">
|
<div class="step-title">
|
||||||
第一步:车型{{
|
第一步:选择车型
|
||||||
selectedCarTypeProxy === "其他"
|
<el-form label-width="120px" class="model-form">
|
||||||
? "其他"
|
<el-form-item label="可参考车型列表" required>
|
||||||
: selectedCarTypeProxy
|
<el-select
|
||||||
}}
|
v-model="selectedCarTypeProxy"
|
||||||
<div
|
placeholder="请选择车型"
|
||||||
v-if="selectedCarTypeProxy === '其他'"
|
filterable
|
||||||
class="reference-model"
|
|
||||||
>
|
>
|
||||||
参考车型:{{ referenceCarType || "未选择" }}
|
<el-option-group
|
||||||
</div>
|
v-for="group in carTypeOptions"
|
||||||
</div>
|
:key="group.label"
|
||||||
<div
|
:label="group.label"
|
||||||
class="step-title"
|
|
||||||
:style="{
|
|
||||||
marginTop:
|
|
||||||
selectedCarTypeProxy === '其他' ? '165px' : '192px',
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
第二步:选择轮对商品
|
<el-option
|
||||||
|
v-for="option in group.options"
|
||||||
|
:key="option.value"
|
||||||
|
:label="option.label"
|
||||||
|
:value="option.value"
|
||||||
|
/>
|
||||||
|
</el-option-group>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="step-title">第二步:选择轮对商品</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="image-box right-align">
|
<div class="image-box right-align">
|
||||||
<img
|
<img
|
||||||
src="/images/3D.png"
|
src="../../../assets/images/3D.png"
|
||||||
alt="3D结构图"
|
alt="3D结构图"
|
||||||
class="main-img"
|
class="main-img"
|
||||||
/>
|
/>
|
||||||
|
|
@ -138,43 +109,26 @@
|
||||||
class="part-table"
|
class="part-table"
|
||||||
style="width: 600px; margin-left: 24px"
|
style="width: 600px; margin-left: 24px"
|
||||||
>
|
>
|
||||||
<el-table-column prop="name" label="部件名称">
|
<el-table-column prop="name" label="部件名称" />
|
||||||
<template #default="scope">
|
<el-table-column prop="spec" label="规格" />
|
||||||
<el-input v-model="scope.row.name" />
|
<el-table-column prop="desc" label="描述" />
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="spec" label="规格">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.spec" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="desc" label="描述">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.desc" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-row">
|
<div class="btn-row">
|
||||||
<el-button @click="handlePrevStep">上一步</el-button>
|
<el-button @click="$emit('prev-step')">上一步</el-button>
|
||||||
<el-button type="primary" @click="handleNextStep">下一步</el-button>
|
<el-button type="primary" @click="$emit('next-step')"
|
||||||
|
>下一步</el-button
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 车型信息弹窗 -->
|
|
||||||
<car-model-dialog
|
|
||||||
v-model="carModelDialogVisible"
|
|
||||||
:car-model="selectedCarModel"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, computed, watch } from "vue";
|
import { ref, computed, watch } from "vue";
|
||||||
import { carTypeOptions, treeData, partInfoMap } from "@/data/stepMockData";
|
import { carTypeOptions, treeData, partInfoMap } from '@/data/stepMockData';
|
||||||
import CarModelDialog from "@/components/CarModelDialog.vue";
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
form: Object,
|
form: Object,
|
||||||
|
|
@ -183,21 +137,6 @@ const props = defineProps({
|
||||||
|
|
||||||
const emit = defineEmits(["update:form", "prev-step", "next-step"]);
|
const emit = defineEmits(["update:form", "prev-step", "next-step"]);
|
||||||
|
|
||||||
const currentStep = ref(1);
|
|
||||||
const carModelDialogVisible = ref(false);
|
|
||||||
const selectedCarModel = ref(null);
|
|
||||||
const referenceCarType = ref("");
|
|
||||||
const deliveryTime = ref("");
|
|
||||||
const deliveryMethod = ref("");
|
|
||||||
|
|
||||||
// 计算属性:参考车型选项(排除"其他"选项)
|
|
||||||
const referenceCarTypeOptions = computed(() => {
|
|
||||||
return carTypeOptions.map((group) => ({
|
|
||||||
...group,
|
|
||||||
options: group.options.filter((option) => option.value !== "其他"),
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
// 彻底双向绑定
|
// 彻底双向绑定
|
||||||
const selectedCarTypeProxy = computed({
|
const selectedCarTypeProxy = computed({
|
||||||
get() {
|
get() {
|
||||||
|
|
@ -278,63 +217,11 @@ const treeProps = { children: "children", label: "label" };
|
||||||
|
|
||||||
function handleTreeSelect(node) {
|
function handleTreeSelect(node) {
|
||||||
if (node && node.id && partInfoMap[node.id]) {
|
if (node && node.id && partInfoMap[node.id]) {
|
||||||
selectedPartInfo.value = { ...partInfoMap[node.id] };
|
selectedPartInfo.value = partInfoMap[node.id];
|
||||||
} else {
|
} else {
|
||||||
selectedPartInfo.value = null;
|
selectedPartInfo.value = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleCarTypeChange(value) {
|
|
||||||
// 只有非"其他"选项才显示车型信息弹窗
|
|
||||||
if (value !== "其他") {
|
|
||||||
const selectedOption = carTypeOptions
|
|
||||||
.flatMap((group) => group.options)
|
|
||||||
.find((option) => option.value === value);
|
|
||||||
|
|
||||||
if (selectedOption) {
|
|
||||||
selectedCarModel.value = {
|
|
||||||
name: selectedOption.label,
|
|
||||||
description: selectedOption.description || "",
|
|
||||||
specifications: selectedOption.specifications || {},
|
|
||||||
image: selectedOption.image || "",
|
|
||||||
};
|
|
||||||
carModelDialogVisible.value = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleReferenceCarTypeChange(value) {
|
|
||||||
// 显示参考车型信息弹窗
|
|
||||||
const selectedOption = referenceCarTypeOptions.value
|
|
||||||
.flatMap((group) => group.options)
|
|
||||||
.find((option) => option.value === value);
|
|
||||||
|
|
||||||
if (selectedOption) {
|
|
||||||
selectedCarModel.value = {
|
|
||||||
name: selectedOption.label,
|
|
||||||
description: selectedOption.description || "",
|
|
||||||
specifications: selectedOption.specifications || {},
|
|
||||||
image: selectedOption.image || "",
|
|
||||||
};
|
|
||||||
carModelDialogVisible.value = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handlePrevStep() {
|
|
||||||
if (currentStep.value === 2) {
|
|
||||||
currentStep.value = 1;
|
|
||||||
} else {
|
|
||||||
emit("prev-step");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleNextStep() {
|
|
||||||
if (currentStep.value === 1) {
|
|
||||||
currentStep.value = 2;
|
|
||||||
} else {
|
|
||||||
emit("next-step");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
@ -381,7 +268,6 @@ function handleNextStep() {
|
||||||
.step {
|
.step {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
}
|
||||||
.step-left {
|
.step-left {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|
@ -390,32 +276,9 @@ function handleNextStep() {
|
||||||
.step-title {
|
.step-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
margin: 15px 0;
|
margin: 15px 0;
|
||||||
color: #333;
|
}
|
||||||
font-weight: 500;
|
.step-title:last-child {
|
||||||
|
margin-top: 145px;
|
||||||
&.active {
|
|
||||||
color: #2156f3;
|
|
||||||
}
|
|
||||||
|
|
||||||
.reference-model {
|
|
||||||
font-size: 14px;
|
|
||||||
color: #666;
|
|
||||||
margin-top: 8px;
|
|
||||||
padding-left: 20px;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
content: "";
|
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
width: 12px;
|
|
||||||
height: 12px;
|
|
||||||
background: #2156f3;
|
|
||||||
border-radius: 50%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.image-box.right-align {
|
.image-box.right-align {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -426,7 +289,6 @@ function handleNextStep() {
|
||||||
.table-title {
|
.table-title {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin: 16px 0 8px 0;
|
margin: 16px 0 8px 0;
|
||||||
color: #333;
|
|
||||||
}
|
}
|
||||||
.tree-table-row {
|
.tree-table-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ import {
|
||||||
defaultDisputeTerms,
|
defaultDisputeTerms,
|
||||||
} from "@/data/stepMockData";
|
} from "@/data/stepMockData";
|
||||||
|
|
||||||
const activeTab = ref("pay");
|
const activeTab = ref('pay');
|
||||||
|
|
||||||
const form = reactive({
|
const form = reactive({
|
||||||
pay: defaultPaymentTerms,
|
pay: defaultPaymentTerms,
|
||||||
|
|
@ -91,7 +91,7 @@ const form = reactive({
|
||||||
background: #fff;
|
background: #fff;
|
||||||
padding: 24px;
|
padding: 24px;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
height: calc(100vh - 320px);
|
height: calc(100vh - 200px);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
@ -120,7 +120,7 @@ const form = reactive({
|
||||||
|
|
||||||
:deep(.el-textarea__inner) {
|
:deep(.el-textarea__inner) {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
min-height: 300px;
|
min-height: 400px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,8 +128,8 @@ const form = reactive({
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
margin-top: 16px;
|
margin-top: 20px;
|
||||||
padding-top: 16px;
|
padding-top: 20px;
|
||||||
border-top: 1px solid #eee;
|
border-top: 1px solid #eee;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -56,18 +56,18 @@
|
||||||
icon="Plus"
|
icon="Plus"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['order:intention:add']"
|
v-hasPermi="['order:intention:add']"
|
||||||
>新增订单/意向单</el-button
|
>新增</el-button
|
||||||
>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
plain
|
plain
|
||||||
icon="View"
|
icon="Edit"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['order:intention:edit']"
|
v-hasPermi="['order:intention:edit']"
|
||||||
>查看</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
|
|
@ -78,7 +78,7 @@
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['order:intention:remove']"
|
v-hasPermi="['order:intention:remove']"
|
||||||
>取消</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar
|
<right-toolbar
|
||||||
|
|
@ -105,22 +105,10 @@
|
||||||
:key="index"
|
:key="index"
|
||||||
style="margin-bottom: 10px"
|
style="margin-bottom: 10px"
|
||||||
>
|
>
|
||||||
<span
|
<span style="font-weight: bold; margin-right: 5px"
|
||||||
:style="{
|
>{{ index + 1 }}、{{ item.date }}:</span
|
||||||
fontWeight: 'bold',
|
|
||||||
marginRight: '5px',
|
|
||||||
color: isPastDate(item.date) ? '#409eff' : 'inherit',
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
{{ index + 1 }}、{{ item.date }}:
|
|
||||||
</span>
|
|
||||||
<span
|
|
||||||
:style="{
|
|
||||||
color: isPastDate(item.date) ? '#409eff' : 'inherit',
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
{{ item.description }}
|
{{ item.description }}
|
||||||
</span>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -154,17 +142,17 @@
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
icon="View"
|
icon="Edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row)"
|
||||||
v-hasPermi="['order:intention:edit']"
|
v-hasPermi="['order:intention:edit']"
|
||||||
>查看</el-button
|
>修改</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
icon="Delete"
|
icon="Delete"
|
||||||
@click="handleDelete(scope.row)"
|
@click="handleDelete(scope.row)"
|
||||||
v-hasPermi="['order:intention:remove']"
|
v-hasPermi="['order:intention:remove']"
|
||||||
>取消</el-button
|
>删除</el-button
|
||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -178,7 +166,7 @@
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- 添加或查看意向订单对话框 -->
|
<!-- 添加或修改意向订单对话框 -->
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||||
<el-form
|
<el-form
|
||||||
ref="intentionRef"
|
ref="intentionRef"
|
||||||
|
|
@ -331,14 +319,14 @@ function handleAdd() {
|
||||||
router.push("/order/create");
|
router.push("/order/create");
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 查看按钮操作 */
|
/** 修改按钮操作 */
|
||||||
function handleUpdate(row) {
|
function handleUpdate(row) {
|
||||||
const id = row.id || ids.value[0];
|
const id = row.id || ids.value[0];
|
||||||
// const intention = mockData.value.find(item => item.id === id)
|
// const intention = mockData.value.find(item => item.id === id)
|
||||||
// if (intention) {
|
// if (intention) {
|
||||||
// form.value = { ...intention }
|
// form.value = { ...intention }
|
||||||
// open.value = true
|
// open.value = true
|
||||||
// title.value = "查看意向订单"
|
// title.value = "修改意向订单"
|
||||||
// }
|
// }
|
||||||
router.push({ path: "/order/create", query: { id: id } });
|
router.push({ path: "/order/create", query: { id: id } });
|
||||||
}
|
}
|
||||||
|
|
@ -352,7 +340,7 @@ function handleUpdate(row) {
|
||||||
// const index = mockData.value.findIndex(item => item.id === form.value.id);
|
// const index = mockData.value.findIndex(item => item.id === form.value.id);
|
||||||
// if (index !== -1) {
|
// if (index !== -1) {
|
||||||
// mockData.value[index] = { ...form.value };
|
// mockData.value[index] = { ...form.value };
|
||||||
// ElMessage.success("查看成功");
|
// ElMessage.success("修改成功");
|
||||||
// }
|
// }
|
||||||
// } else {
|
// } else {
|
||||||
// // Add operation
|
// // Add operation
|
||||||
|
|
@ -367,11 +355,11 @@ function handleUpdate(row) {
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/** 取消按钮操作 */
|
/** 删除按钮操作 */
|
||||||
function handleDelete(row) {
|
function handleDelete(row) {
|
||||||
const intentionIds = row.id ? [row.id] : ids.value;
|
const intentionIds = row.id ? [row.id] : ids.value;
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
'是否确认取消意向订单编号为"' + intentionIds + '"的数据项?',
|
'是否确认删除意向订单编号为"' + intentionIds + '"的数据项?',
|
||||||
"警告",
|
"警告",
|
||||||
{
|
{
|
||||||
confirmButtonText: "确定",
|
confirmButtonText: "确定",
|
||||||
|
|
@ -380,14 +368,14 @@ function handleDelete(row) {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// 模拟取消
|
// 模拟删除
|
||||||
mockData.value = mockData.value.filter(
|
mockData.value = mockData.value.filter(
|
||||||
(item) => !intentionIds.includes(item.id)
|
(item) => !intentionIds.includes(item.id)
|
||||||
);
|
);
|
||||||
ids.value = []; // Clear selection after deletion
|
ids.value = []; // Clear selection after deletion
|
||||||
single.value = true;
|
single.value = true;
|
||||||
multiple.value = true;
|
multiple.value = true;
|
||||||
ElMessage.success("取消成功");
|
ElMessage.success("删除成功");
|
||||||
getList();
|
getList();
|
||||||
})
|
})
|
||||||
.catch(() => {}); // Catch cancel to avoid console error
|
.catch(() => {}); // Catch cancel to avoid console error
|
||||||
|
|
@ -406,15 +394,6 @@ function handleDelete(row) {
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// Add isPastDate function
|
|
||||||
function isPastDate(dateStr) {
|
|
||||||
const today = new Date();
|
|
||||||
today.setHours(0, 0, 0, 0);
|
|
||||||
const itemDate = new Date(dateStr);
|
|
||||||
itemDate.setHours(0, 0, 0, 0);
|
|
||||||
return itemDate <= today;
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
|
|
|
||||||