mirror of
https://gitee.com/ZhongBangKeJi/crmeb_java.git
synced 2026-04-24 12:28:33 +08:00
我们发布啦
This commit is contained in:
@@ -0,0 +1,190 @@
|
||||
<template>
|
||||
<div class="divBox">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<div class="container">
|
||||
<el-form ref="form" inline :model="form">
|
||||
<el-form-item label="搜索:">
|
||||
<el-input v-model="form.name" placeholder="请输入内容" class="selWidth" size="small">
|
||||
<el-button slot="append" icon="el-icon-search" @click="handleSearch" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-button type="primary" size="mini" @click="handleSubmit()">添加运费模板</el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableData.list"
|
||||
style="width: 100%"
|
||||
size="mini"
|
||||
>
|
||||
<el-table-column
|
||||
prop="id"
|
||||
label="ID"
|
||||
min-width="60"
|
||||
/>
|
||||
<el-table-column
|
||||
label="模板名称"
|
||||
min-width="150"
|
||||
prop="name"
|
||||
/>
|
||||
<el-table-column
|
||||
min-width="100"
|
||||
label="计费方式"
|
||||
prop="type"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<p>{{ row.type | typeFilter }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
min-width="100"
|
||||
label="指定包邮"
|
||||
prop="appoint"
|
||||
>
|
||||
<template slot-scope="{row}">
|
||||
<p>{{ row.appoint | statusFilter }}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
min-width="120"
|
||||
label="指定区域不配送"
|
||||
prop="type"
|
||||
/>
|
||||
<el-table-column
|
||||
label="排序"
|
||||
min-width="100"
|
||||
prop="sort"
|
||||
/>
|
||||
<el-table-column
|
||||
label="添加时间"
|
||||
min-width="150"
|
||||
prop="createTime"
|
||||
/>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
fixed="right"
|
||||
width="120"
|
||||
label="操作"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" size="small" @click="bindEdit(scope.row)">修改</el-button>
|
||||
<el-button type="text" size="small" @click="bindDelete(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="block-pagination">
|
||||
<el-pagination
|
||||
:page-sizes="[12, 20, 40, 60]"
|
||||
:page-size="tableData.limit"
|
||||
:current-page="tableData.page"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="tableData.total"
|
||||
@current-change="pageChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
</div>
|
||||
</el-card>
|
||||
<CreatTemplates ref="addTemplates" @getList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CreatTemplates from './creatTemplates'
|
||||
import * as logistics from '@/api/logistics.js'
|
||||
export default {
|
||||
name: 'ShippingTemplates',
|
||||
filters: {
|
||||
statusFilter(status) {
|
||||
const statusMap = {
|
||||
true: '开启',
|
||||
false: '关闭'
|
||||
}
|
||||
return statusMap[status]
|
||||
},
|
||||
typeFilter(status) {
|
||||
const statusMap = {
|
||||
1: '按件数',
|
||||
2: '按重量',
|
||||
3: '按体积'
|
||||
}
|
||||
return statusMap[status]
|
||||
}
|
||||
},
|
||||
components: { CreatTemplates },
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
form: {
|
||||
name: ''
|
||||
},
|
||||
tableData: '',
|
||||
page: 1,
|
||||
limit: 12,
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
// 添加
|
||||
handleSubmit() {
|
||||
this.$refs.addTemplates.dialogVisible = true
|
||||
this.$refs.addTemplates.getCityList()
|
||||
this.$refs.addTemplates.changType(0, this.te)
|
||||
},
|
||||
handleSearch() {
|
||||
this.getDataList()
|
||||
},
|
||||
// 分页
|
||||
pageChange(e) {
|
||||
this.page = e
|
||||
this.getDataList()
|
||||
},
|
||||
handleSizeChange(e) {
|
||||
this.limit = e
|
||||
this.getDataList()
|
||||
},
|
||||
// 数据列表
|
||||
getDataList() {
|
||||
this.loading = true
|
||||
logistics.shippingTemplatesList({
|
||||
name: this.form.name,
|
||||
page: this.page,
|
||||
limit: this.limit
|
||||
}).then(res => {
|
||||
this.loading = false
|
||||
this.tableData = res
|
||||
})
|
||||
},
|
||||
// 编辑
|
||||
bindEdit(item) {
|
||||
// this.$refs.addTemplates.dialogVisible = true
|
||||
this.$refs.addTemplates.getCityList()
|
||||
this.$refs.addTemplates.getInfo(item.id, item.appoint)
|
||||
this.$refs.addTemplates.changType(1)
|
||||
},
|
||||
// 删除
|
||||
bindDelete(item) {
|
||||
this.$modalSure().then(() => {
|
||||
logistics.shippingDetete({ id: item.id }).then(res => {
|
||||
this.$message.success('删除成功')
|
||||
this.getDataList()
|
||||
})
|
||||
})
|
||||
// logistics.shippingDetete()
|
||||
},
|
||||
getList() {
|
||||
this.getDataList()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.selWidth{
|
||||
width: 350px;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user