新增订单列表对接数据

This commit is contained in:
gyq
2024-03-14 16:00:19 +08:00
parent 87d084dfed
commit 0998c30b1a
17 changed files with 701 additions and 131 deletions

View File

@@ -43,7 +43,6 @@
</template>
</el-table-column>
<el-table-column label="商品信息">
<template v-slot="scope">
<div class="shop_list">
<div class="item" v-for="item in scope.row.goods" :key="item.id">
@@ -57,7 +56,6 @@
</template>
</el-table-column>
<el-table-column label="几选几">
<template v-slot="scope">
<span>{{ scope.row.goods.length }}</span>
<el-input-number v-model="scope.row.number" controls-position="right"
@@ -65,7 +63,6 @@
</template>
</el-table-column>
<el-table-column label="操作" width="160">
<template v-slot="scope">
<el-button type="text" @click="tableAddShop(scope.$index, scope.row.goods)">添加商品</el-button>
<el-button type="text" @click="form.groupSnap.splice(scope.$index, 1)">删除分组</el-button>
@@ -79,32 +76,36 @@
<el-table :data="form.skuList" border>
<el-table-column label="售价" prop="salePrice">
<template v-slot="scope">
<el-input-number v-model="scope.row.salePrice"></el-input-number>
<el-input-number v-model="scope.row.salePrice" controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column label="会员价" prop="memberPrice">
<template v-slot="scope">
<el-input-number v-model="scope.row.memberPrice"></el-input-number>
<el-input-number v-model="scope.row.memberPrice"
controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column label="成本价" prop="costPrice">
<template v-slot="scope">
<el-input-number v-model="scope.row.costPrice"></el-input-number>
<el-input-number v-model="scope.row.costPrice" controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column label="原价" prop="originPrice">
<template v-slot="scope">
<el-input-number v-model="scope.row.originPrice"></el-input-number>
<el-input-number v-model="scope.row.originPrice"
controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column label="库存数量" prop="stockNumber">
<template v-slot="scope">
<el-input-number v-model="scope.row.stockNumber" :disabled="!!form.id"></el-input-number>
<el-input-number v-model="scope.row.stockNumber" :disabled="!!form.id"
controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column label="分销金额" prop="firstShared">
<template v-slot="scope">
<el-input-number v-model="scope.row.firstShared"></el-input-number>
<el-input-number v-model="scope.row.firstShared"
controls-position="right"></el-input-number>
</template>
</el-table-column>
<el-table-column label="商品条码">
@@ -427,9 +428,9 @@ export default {
}
},
// 提交
async submitHandle() {
try {
this.$refs.formRef.validate(async faild => {
submitHandle() {
this.$refs.formRef.validate(async faild => {
try {
if (faild) {
this.loading = true
this.form.lowPrice = this.form.skuList[0].salePrice
@@ -448,13 +449,13 @@ export default {
type: 'success'
});
this.$router.back()
this.loading = true
this.loading = false
}
})
} catch (error) {
this.loading = true
console.log(error)
}
} catch (error) {
this.loading = false
console.log(error)
}
})
},
// 给分组添加商品
tableAddShop(index, goods) {

View File

@@ -91,7 +91,7 @@ export default {
},
// 分页回调
paginationChange(e) {
this.tableData.page = e - 1;
this.tableData.page = e -1;
this.getTableData()
},
// 删除

View File

@@ -12,9 +12,12 @@
</el-button>
</div>
<div class="shop_list">
<div class="item" v-for="(item, index) in productIds" :key="item.id" :data-index="index + 1"
<div class="item_wrap" v-for="(item, index) in productIds" :key="item.id"
@click="productIds.splice(index, 1)">
<el-image :src="item.coverImg" style="width: 100%;height: 100%;"></el-image>
<div class="item" :data-index="index + 1">
<el-image :src="item.coverImg" style="width: 100%;height: 100%;"></el-image>
</div>
<div class="name">{{ item.name }}</div>
</div>
</div>
</el-form-item>
@@ -133,60 +136,70 @@ export default {
display: flex;
flex-wrap: wrap;
.item {
.item_wrap {
$size: 80px;
$radius: 4px;
width: $size;
height: $size;
border-radius: $radius;
overflow: hidden;
position: relative;
margin-right: 10px;
margin-top: 10px;
&:hover {
cursor: pointer;
.item {
$radius: 4px;
width: $size;
height: $size;
border-radius: $radius;
overflow: hidden;
position: relative;
margin-right: 10px;
margin-top: 10px;
&:hover {
cursor: pointer;
&::before {
transform: translateY(0);
}
}
&::after {
content: attr(data-index);
font-size: 12px;
height: 20px;
display: flex;
padding: 0 10px;
border-radius: 0 0 $radius 0;
align-items: center;
background-color: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
color: #fff;
position: absolute;
top: 0;
left: 0;
z-index: 10;
}
&::before {
transform: translateY(0);
content: '删除';
font-size: 12px;
width: 100%;
height: 20px;
display: flex;
padding: 0 10px;
align-items: center;
justify-content: center;
background-color: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
color: #fff;
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
transform: translateY(100%);
transition: all .1s ease-in-out;
}
}
&::after {
content: attr(data-index);
font-size: 12px;
height: 20px;
display: flex;
padding: 0 10px;
border-radius: 0 0 $radius 0;
align-items: center;
background-color: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
color: #fff;
position: absolute;
top: 0;
left: 0;
z-index: 10;
}
&::before {
content: '删除';
font-size: 12px;
width: 100%;
height: 20px;
display: flex;
padding: 0 10px;
align-items: center;
justify-content: center;
background-color: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
color: #fff;
position: absolute;
bottom: 0;
left: 0;
z-index: 10;
transform: translateY(100%);
transition: all .1s ease-in-out;
.name {
width: $size;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}

View File

@@ -62,7 +62,7 @@ export default {
},
// 分页回调
paginationChange(e) {
this.tableData.page = e
this.tableData.page = e - 1
this.getTableData()
},
// 删除