2024-10-16 18:15:19 +08:00
|
|
|
<template>
|
|
|
|
|
<ai-list class="Template">
|
|
|
|
|
<ai-title
|
|
|
|
|
slot="title"
|
|
|
|
|
title="模板管理"
|
|
|
|
|
isShowBottomBorder>
|
|
|
|
|
</ai-title>
|
|
|
|
|
<template slot="content">
|
|
|
|
|
<ai-search-bar>
|
|
|
|
|
<template #left>
|
2024-10-18 13:37:05 +08:00
|
|
|
<el-button type="primary" size="small" @click="toAdd">添加</el-button>
|
2024-10-16 18:15:19 +08:00
|
|
|
</template>
|
|
|
|
|
<template #right>
|
|
|
|
|
</template>
|
|
|
|
|
</ai-search-bar>
|
|
|
|
|
<ai-table
|
|
|
|
|
:tableData="tableData"
|
|
|
|
|
:col-configs="colConfigs"
|
|
|
|
|
:total="total"
|
|
|
|
|
:current.sync="search.current"
|
|
|
|
|
:size.sync="search.size"
|
|
|
|
|
style="margin-top: 8px;"
|
|
|
|
|
@getList="getList">
|
2024-10-18 13:37:05 +08:00
|
|
|
<el-table-column slot="options" label="操作" align="center" fixed="right" width="220px">
|
2024-10-16 18:15:19 +08:00
|
|
|
<template v-slot="{ row }">
|
|
|
|
|
<div class="table-options">
|
2024-10-18 13:37:05 +08:00
|
|
|
<el-button type="text" @click="toAddSku(row.url)">添加SKU</el-button>
|
|
|
|
|
<el-button type="text" @click="toAdd(row.url)">编辑</el-button>
|
|
|
|
|
<el-button type="text" @click="toDetail(row.url)">删除</el-button>
|
2024-10-16 18:15:19 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</ai-table>
|
|
|
|
|
</template>
|
|
|
|
|
</ai-list>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
2024-10-26 13:55:47 +08:00
|
|
|
name: 'PringTemplate',
|
2024-10-16 18:15:19 +08:00
|
|
|
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
colConfigs: [
|
|
|
|
|
{ prop: 'name', label: '模板名称', align: 'left' },
|
2024-10-18 13:37:05 +08:00
|
|
|
{ prop: 'count', label: '绑定SKU数量', align: 'center' },
|
2024-10-16 18:15:19 +08:00
|
|
|
{ prop: 'createTime', label: '创建时间', align: 'center' },
|
|
|
|
|
],
|
2024-10-18 13:37:05 +08:00
|
|
|
tableData: [
|
|
|
|
|
{
|
|
|
|
|
name: '电池',
|
|
|
|
|
count: 2
|
|
|
|
|
}
|
|
|
|
|
],
|
2024-10-16 18:15:19 +08:00
|
|
|
total: 0,
|
|
|
|
|
search: {
|
|
|
|
|
current: 1,
|
2024-10-18 13:37:05 +08:00
|
|
|
size: 10
|
|
|
|
|
}
|
2024-10-16 18:15:19 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
created () {
|
2024-10-26 22:49:11 +08:00
|
|
|
this.getList()
|
2024-10-16 18:15:19 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
|
toAdd () {
|
|
|
|
|
this.$router.push('/addLabelsTemplate')
|
|
|
|
|
},
|
|
|
|
|
|
2024-10-18 13:37:05 +08:00
|
|
|
toAddSku () {
|
|
|
|
|
this.$router.push('/skuManage')
|
|
|
|
|
},
|
|
|
|
|
|
2024-10-16 18:15:19 +08:00
|
|
|
getList () {
|
2024-10-26 22:49:11 +08:00
|
|
|
this.$http.post('/api/template/getPage', null, {
|
2024-10-16 18:15:19 +08:00
|
|
|
params: {
|
|
|
|
|
...this.search
|
|
|
|
|
}
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res.code === 0) {
|
2024-10-26 22:49:11 +08:00
|
|
|
this.tableData = res.data.records
|
|
|
|
|
this.total = res.data.total
|
2024-10-16 18:15:19 +08:00
|
|
|
}
|
|
|
|
|
})
|
2024-10-18 13:37:05 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
onConfirm () {
|
|
|
|
|
|
2024-10-16 18:15:19 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
</style>
|