|
|
|
@ -4,7 +4,7 @@ |
|
|
|
|
<el-card class="box-card"> |
|
|
|
|
<div slot="header" class="clearfix"> |
|
|
|
|
<el-button size="small" type="primary" @click="onAdd" |
|
|
|
|
>添加店铺类型 |
|
|
|
|
>添加店铺类型 |
|
|
|
|
</el-button> |
|
|
|
|
</div> |
|
|
|
|
<el-table |
|
|
|
@ -15,7 +15,7 @@ |
|
|
|
|
highlight-current-row |
|
|
|
|
class="switchTable" |
|
|
|
|
> |
|
|
|
|
<el-table-column prop="mer_type_id" label="ID" min-width="60" /> |
|
|
|
|
<el-table-column prop="mer_type_id" label="ID" min-width="60"/> |
|
|
|
|
<el-table-column |
|
|
|
|
prop="type_name" |
|
|
|
|
label="店铺类型名称" |
|
|
|
@ -24,8 +24,8 @@ |
|
|
|
|
<el-table-column prop="type_name" label="店铺保证金" min-width="200"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span class="spBlock">{{ |
|
|
|
|
scope.row.is_margin ? scope.row.margin + "元" : "无" |
|
|
|
|
}}</span> |
|
|
|
|
scope.row.is_margin ? scope.row.margin + '元' : '无' |
|
|
|
|
}}</span> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
@ -54,22 +54,22 @@ |
|
|
|
|
type="text" |
|
|
|
|
size="small" |
|
|
|
|
@click="handleDetail(scope.row)" |
|
|
|
|
>详情 |
|
|
|
|
>详情 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="text" size="small" @click="onEdit(scope.row)" |
|
|
|
|
>编辑 |
|
|
|
|
>编辑 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
size="small" |
|
|
|
|
@click="handleDelete(scope.row.mer_type_id, scope.$index)" |
|
|
|
|
>删除 |
|
|
|
|
>删除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
size="small" |
|
|
|
|
@click="handleMark(scope.row.mer_type_id)" |
|
|
|
|
>备注 |
|
|
|
|
>备注 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
@ -110,7 +110,7 @@ |
|
|
|
|
/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="店铺类型要求:"> |
|
|
|
|
<el-input type="textarea" v-model="formValidate.type_info" /> |
|
|
|
|
<el-input type="textarea" v-model="formValidate.type_info"/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="店铺保证金:"> |
|
|
|
|
<el-radio-group v-model="formValidate.is_margin"> |
|
|
|
@ -118,7 +118,7 @@ |
|
|
|
|
<el-radio :label="1">有</el-radio> |
|
|
|
|
</el-radio-group> |
|
|
|
|
<div v-if="formValidate.is_margin == 1" class="input_inline"> |
|
|
|
|
<el-input v-model="formValidate.margin" placeholder="请输入单位" /> |
|
|
|
|
<el-input v-model="formValidate.margin" placeholder="请输入单位"/> |
|
|
|
|
单位:元 |
|
|
|
|
</div> |
|
|
|
|
</el-form-item> |
|
|
|
@ -139,7 +139,7 @@ |
|
|
|
|
></el-tree> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="其它说明:"> |
|
|
|
|
<el-input type="textarea" v-model="formValidate.description" /> |
|
|
|
|
<el-input type="textarea" v-model="formValidate.description"/> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item style="margin-top: 30px"> |
|
|
|
|
<el-button |
|
|
|
@ -148,7 +148,7 @@ |
|
|
|
|
class="submission" |
|
|
|
|
size="small" |
|
|
|
|
@click="handleSubmit('formValidate')" |
|
|
|
|
>提交 |
|
|
|
|
>提交 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
v-else |
|
|
|
@ -156,7 +156,7 @@ |
|
|
|
|
class="submission" |
|
|
|
|
size="small" |
|
|
|
|
@click="handleUpdate('formValidate')" |
|
|
|
|
>提交 |
|
|
|
|
>提交 |
|
|
|
|
</el-button> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
@ -183,7 +183,7 @@ |
|
|
|
|
{{ |
|
|
|
|
formDetailValidate.type_name |
|
|
|
|
? formDetailValidate.type_name |
|
|
|
|
: "暂无数据" |
|
|
|
|
: '暂无数据' |
|
|
|
|
}} |
|
|
|
|
</span> |
|
|
|
|
</el-form-item> |
|
|
|
@ -191,13 +191,15 @@ |
|
|
|
|
{{ |
|
|
|
|
formDetailValidate.type_info |
|
|
|
|
? formDetailValidate.type_info |
|
|
|
|
: "暂无数据" |
|
|
|
|
}}</el-form-item |
|
|
|
|
: '暂无数据' |
|
|
|
|
}} |
|
|
|
|
</el-form-item |
|
|
|
|
> |
|
|
|
|
<el-form-item label="店铺保证金:"> |
|
|
|
|
{{ |
|
|
|
|
formDetailValidate.margin ? formDetailValidate.margin : "暂无数据" |
|
|
|
|
}}</el-form-item |
|
|
|
|
formDetailValidate.margin ? formDetailValidate.margin : '暂无数据' |
|
|
|
|
}} |
|
|
|
|
</el-form-item |
|
|
|
|
> |
|
|
|
|
<el-form-item label="店铺权限:"> |
|
|
|
|
<el-tree |
|
|
|
@ -210,23 +212,25 @@ |
|
|
|
|
{{ |
|
|
|
|
formDetailValidate.description |
|
|
|
|
? formDetailValidate.description |
|
|
|
|
: "暂无数据" |
|
|
|
|
}}</el-form-item |
|
|
|
|
: '暂无数据' |
|
|
|
|
}} |
|
|
|
|
</el-form-item |
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
<el-form-item label="创建时间:"> |
|
|
|
|
{{ |
|
|
|
|
formDetailValidate.create_time |
|
|
|
|
? formDetailValidate.create_time |
|
|
|
|
: "暂无数据" |
|
|
|
|
}}</el-form-item |
|
|
|
|
: '暂无数据' |
|
|
|
|
}} |
|
|
|
|
</el-form-item |
|
|
|
|
> |
|
|
|
|
|
|
|
|
|
<el-form-item label="最新修改时间:" |
|
|
|
|
>{{ |
|
|
|
|
>{{ |
|
|
|
|
formDetailValidate.update_time |
|
|
|
|
? formDetailValidate.update_time |
|
|
|
|
: "暂无数据" |
|
|
|
|
: '暂无数据' |
|
|
|
|
}} |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
@ -252,21 +256,21 @@ import { |
|
|
|
|
storeTypeDeleteApi, |
|
|
|
|
storeJurisdictionApi, |
|
|
|
|
merchantTypeMarkForm, |
|
|
|
|
merchantTypeMarkApi, |
|
|
|
|
} from "@/api/merchant"; |
|
|
|
|
import { fromList } from "@/libs/constants.js"; |
|
|
|
|
import { roterPre } from "@/settings"; |
|
|
|
|
import SettingMer from "@/libs/settingMer"; |
|
|
|
|
import Cookies from "js-cookie"; |
|
|
|
|
merchantTypeMarkApi |
|
|
|
|
} from '@/api/merchant' |
|
|
|
|
import { fromList } from '@/libs/constants.js' |
|
|
|
|
import { roterPre } from '@/settings' |
|
|
|
|
import SettingMer from '@/libs/settingMer' |
|
|
|
|
import Cookies from 'js-cookie' |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
name: "MerchantList", |
|
|
|
|
name: 'MerchantList', |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
//详情弹框 |
|
|
|
|
dialogDetailVisible: false, |
|
|
|
|
formDetailValidate: {}, |
|
|
|
|
detailTypeId: "", |
|
|
|
|
detailTypeId: '', |
|
|
|
|
|
|
|
|
|
fromList: fromList, |
|
|
|
|
roterPre: roterPre, |
|
|
|
@ -275,195 +279,195 @@ export default { |
|
|
|
|
permissions: [], //店铺类型 |
|
|
|
|
tableData: { |
|
|
|
|
data: [], |
|
|
|
|
total: 0, |
|
|
|
|
total: 0 |
|
|
|
|
}, |
|
|
|
|
tableFrom: { |
|
|
|
|
page: 1, |
|
|
|
|
limit: 20, |
|
|
|
|
limit: 20 |
|
|
|
|
}, |
|
|
|
|
formValidate: { |
|
|
|
|
type_name: "", |
|
|
|
|
type_info: "", |
|
|
|
|
type_name: '', |
|
|
|
|
type_info: '', |
|
|
|
|
is_margin: 1, |
|
|
|
|
margin: 0, |
|
|
|
|
auth: [], |
|
|
|
|
description: "", |
|
|
|
|
description: '' |
|
|
|
|
}, |
|
|
|
|
ruleValidate: { |
|
|
|
|
type_name: [ |
|
|
|
|
{ required: true, message: "请输入店铺类型名称", trigger: "blur" }, |
|
|
|
|
{ required: true, message: '请输入店铺类型名称', trigger: 'blur' } |
|
|
|
|
], |
|
|
|
|
auth: [ |
|
|
|
|
{ required: true, message: "请选择店铺权限", trigger: "change" }, |
|
|
|
|
], |
|
|
|
|
{ required: true, message: '请选择店铺权限', trigger: 'change' } |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
dialogVisible: false, |
|
|
|
|
isEdit: false, |
|
|
|
|
typeId: "", |
|
|
|
|
cccc: "", |
|
|
|
|
typeId: '', |
|
|
|
|
cccc: '', |
|
|
|
|
props: { |
|
|
|
|
multiple: true, |
|
|
|
|
expandTrigger: "hover", |
|
|
|
|
emitPath: false, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
expandTrigger: 'hover', |
|
|
|
|
emitPath: false |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getList(""); |
|
|
|
|
this.getList('') |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 列表 |
|
|
|
|
getList(num) { |
|
|
|
|
this.listLoading = true; |
|
|
|
|
this.tableFrom.page = num ? num : this.tableFrom.page; |
|
|
|
|
this.listLoading = true |
|
|
|
|
this.tableFrom.page = num ? num : this.tableFrom.page |
|
|
|
|
storeTypeLstApi(this.tableFrom) |
|
|
|
|
.then((res) => { |
|
|
|
|
this.tableData.data = res.data.list; |
|
|
|
|
this.tableData.total = res.data.count; |
|
|
|
|
this.listLoading = false; |
|
|
|
|
this.jurisdiction(); |
|
|
|
|
this.tableData.data = res.data.list |
|
|
|
|
this.tableData.total = res.data.count |
|
|
|
|
this.listLoading = false |
|
|
|
|
this.jurisdiction() |
|
|
|
|
}) |
|
|
|
|
.catch((res) => { |
|
|
|
|
this.listLoading = false; |
|
|
|
|
this.$message.error(res.message); |
|
|
|
|
}); |
|
|
|
|
this.listLoading = false |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
pageChange(page) { |
|
|
|
|
this.tableFrom.page = page; |
|
|
|
|
this.getList(""); |
|
|
|
|
this.tableFrom.page = page |
|
|
|
|
this.getList('') |
|
|
|
|
}, |
|
|
|
|
handleSizeChange(val) { |
|
|
|
|
this.tableFrom.limit = val; |
|
|
|
|
this.getList(1); |
|
|
|
|
this.tableFrom.limit = val |
|
|
|
|
this.getList(1) |
|
|
|
|
}, |
|
|
|
|
handleClose() { |
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
this.dialogVisible = false |
|
|
|
|
}, |
|
|
|
|
// 添加 |
|
|
|
|
onAdd() { |
|
|
|
|
this.dialogVisible = true; |
|
|
|
|
this.isEdit = false; |
|
|
|
|
this.dialogVisible = true |
|
|
|
|
this.isEdit = false |
|
|
|
|
// this.jurisdiction(); |
|
|
|
|
this.formValidate = { |
|
|
|
|
type_name: "", |
|
|
|
|
type_info: "", |
|
|
|
|
type_name: '', |
|
|
|
|
type_info: '', |
|
|
|
|
is_margin: 1, |
|
|
|
|
margin: 0, |
|
|
|
|
description: "", |
|
|
|
|
auth: [], |
|
|
|
|
}; |
|
|
|
|
this.$refs.tree && this.$refs.tree.setCheckedKeys([]); |
|
|
|
|
description: '', |
|
|
|
|
auth: [] |
|
|
|
|
} |
|
|
|
|
this.$refs.tree && this.$refs.tree.setCheckedKeys([]) |
|
|
|
|
}, |
|
|
|
|
//获取权限 |
|
|
|
|
jurisdiction() { |
|
|
|
|
storeJurisdictionApi().then((res) => { |
|
|
|
|
function loadData(lst) { |
|
|
|
|
lst.forEach((v) => { |
|
|
|
|
v.value = v.id; |
|
|
|
|
v.label = v.title; |
|
|
|
|
delete v.id; |
|
|
|
|
delete v.title; |
|
|
|
|
v.value = v.id |
|
|
|
|
v.label = v.title |
|
|
|
|
delete v.id |
|
|
|
|
delete v.title |
|
|
|
|
if (v.children) { |
|
|
|
|
if (!v.children.length) { |
|
|
|
|
delete v.children; |
|
|
|
|
delete v.children |
|
|
|
|
} else { |
|
|
|
|
loadData(v.children); |
|
|
|
|
loadData(v.children) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return lst; |
|
|
|
|
}) |
|
|
|
|
return lst |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.permissions = loadData(res.data); |
|
|
|
|
}); |
|
|
|
|
this.permissions = loadData(res.data) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
handleSubmit(name) { |
|
|
|
|
this.$refs[name].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
storeTypeCreateApi(this.formValidate) |
|
|
|
|
.then(async (res) => { |
|
|
|
|
this.$message.success(res.message); |
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
this.getList(""); |
|
|
|
|
.then(async(res) => { |
|
|
|
|
this.$message.success(res.message) |
|
|
|
|
this.dialogVisible = false |
|
|
|
|
this.getList('') |
|
|
|
|
}) |
|
|
|
|
.catch((res) => { |
|
|
|
|
this.$message.error(res.message); |
|
|
|
|
}); |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 编辑 |
|
|
|
|
onEdit(row) { |
|
|
|
|
this.isEdit = true; |
|
|
|
|
this.dialogVisible = true; |
|
|
|
|
this.typeId = row.mer_type_id; |
|
|
|
|
this.isEdit = true |
|
|
|
|
this.dialogVisible = true |
|
|
|
|
this.typeId = row.mer_type_id |
|
|
|
|
this.formValidate = { |
|
|
|
|
type_name: row.type_name, |
|
|
|
|
type_info: row.type_info, |
|
|
|
|
is_margin: row.is_margin || 0, |
|
|
|
|
margin: row.margin || 0, |
|
|
|
|
auth: row.auth_ids, |
|
|
|
|
description: row.description, |
|
|
|
|
}; |
|
|
|
|
this.$refs.tree && this.$refs.tree.setCheckedKeys(row.auth_ids); |
|
|
|
|
description: row.description |
|
|
|
|
} |
|
|
|
|
this.$refs.tree && this.$refs.tree.setCheckedKeys(row.auth_ids) |
|
|
|
|
// this.jurisdiction(); |
|
|
|
|
}, |
|
|
|
|
//详情关闭 |
|
|
|
|
handleDetailClose() { |
|
|
|
|
this.dialogDetailVisible = false; |
|
|
|
|
this.getList(); |
|
|
|
|
this.dialogDetailVisible = false |
|
|
|
|
this.getList() |
|
|
|
|
}, |
|
|
|
|
// 详情 |
|
|
|
|
handleDetail(row) { |
|
|
|
|
this.dialogDetailVisible = true; |
|
|
|
|
this.detailTypeId = row.mer_type_id; |
|
|
|
|
this.getDetail(); |
|
|
|
|
this.dialogDetailVisible = true |
|
|
|
|
this.detailTypeId = row.mer_type_id |
|
|
|
|
this.getDetail() |
|
|
|
|
}, |
|
|
|
|
getDetail() { |
|
|
|
|
merchantTypeMarkApi(this.detailTypeId).then((res) => { |
|
|
|
|
this.formDetailValidate = res.data; |
|
|
|
|
}); |
|
|
|
|
this.formDetailValidate = res.data |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
handleUpdate(name) { |
|
|
|
|
this.$refs[name].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
storeTypeUpdateApi(this.typeId, this.formValidate) |
|
|
|
|
.then(async (res) => { |
|
|
|
|
this.$message.success(res.message); |
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
this.getList(""); |
|
|
|
|
.then(async(res) => { |
|
|
|
|
this.$message.success(res.message) |
|
|
|
|
this.dialogVisible = false |
|
|
|
|
this.getList('') |
|
|
|
|
}) |
|
|
|
|
.catch((res) => { |
|
|
|
|
this.$message.error(res.message); |
|
|
|
|
}); |
|
|
|
|
this.$message.error(res.message) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
return false; |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 删除 |
|
|
|
|
handleDelete(id) { |
|
|
|
|
this.$modalSure("确定删除该店铺类型吗").then(() => { |
|
|
|
|
this.$modalSure('确定删除该店铺类型吗').then(() => { |
|
|
|
|
storeTypeDeleteApi(id) |
|
|
|
|
.then(({ message }) => { |
|
|
|
|
this.$message.success(message); |
|
|
|
|
this.getList(""); |
|
|
|
|
this.$message.success(message) |
|
|
|
|
this.getList('') |
|
|
|
|
}) |
|
|
|
|
.catch(({ message }) => { |
|
|
|
|
this.$message.error(message); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
this.$message.error(message) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 备注 |
|
|
|
|
handleMark(id) { |
|
|
|
|
// console.log(id,'9999999'); |
|
|
|
|
this.$modalForm(merchantTypeMarkForm(id)).then(() => this.getList()); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
this.$modalForm(merchantTypeMarkForm(id)).then(() => this.getList()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
|
|