diff --git a/src/api/user.js b/src/api/user.js index aa3f473..b8538f7 100644 --- a/src/api/user.js +++ b/src/api/user.js @@ -60,6 +60,10 @@ export function getMenusApi() { export function createUserApi() { return request.get(`user/create`) } + +export function getCity() { + return request.get(`user/create`) +} /** * @description 用户分组 -- 编辑表单 * @param {Object} param params {Object} 传值参数 @@ -98,6 +102,14 @@ export function labelEditApi(id) { export function labelFormApi() { return request.get('user/label/form') } + +// wmc + + +export function labelFormApi2() { + return request.get('user/label/form2') +} + /** * @description 用户标签 -- 列表 */ @@ -113,9 +125,44 @@ export function labelDeleteApi(id) { /** * @description 用户列表 -- 列表 */ + export function userLstApi(data) { return request.get('user/lst', data) } + +//wmc +export function userLstApi2(data) { + return request.get('partner/role/list', data) +} + +export function userLstApi1(data) { + return request.get('store/brand/brandList', data) +} + +export function userLstApi3(data) { + return request.get('store/brand/city/0', data) +} +export function userLstApi4(data) { + return request.get('store/brand/category/lst', data) +} + +export function userLstApi5(data) { + return request.post('partner/role/add', data) +} + +export function userLstApi6(id) { + return request.get(`partner/role/detail/${id}`) +} + +export function userLstApi7(data) { + return request.post('partner/role/update', data) +} + +export function userLstApi8(id) { + return request.get(`partner/role/delete/${id}`) +} + + /** * @description 用户列表 -- 设置分组 */ @@ -128,6 +175,9 @@ export function changeGroupApi(id) { export function changelabelApi(id) { return request.get(`user/change_label/form/${id}`) } +export function changelabelApi2(id) { + return request.get(`user/partner/${id}`) +} /** * @description 用户列表 -- 编辑会员等级 */ @@ -310,7 +360,7 @@ export function recordListImportApi(data) { } /** * 获取版权信息 - * @returns + * @returns */ export function getVersion() { return request.get('../api/version') @@ -374,4 +424,4 @@ export function getVersion() { */ export function giveMemberApi(id) { return request.get(`user/svip/${id}/form`) -} \ No newline at end of file +} diff --git a/src/views/merchant/type/index.vue b/src/views/merchant/type/index.vue index e35fec0..555bbf2 100644 --- a/src/views/merchant/type/index.vue +++ b/src/views/merchant/type/index.vue @@ -4,7 +4,7 @@
添加店铺类型 + >添加店铺类型
- + 详情 + >详情 编辑 + >编辑 删除 + >删除 备注 + >备注 @@ -110,7 +110,7 @@ /> - + @@ -118,7 +118,7 @@
- + 单位:元
@@ -139,7 +139,7 @@ > - + 提交 + >提交 提交 + >提交 @@ -183,7 +183,7 @@ {{ formDetailValidate.type_name ? formDetailValidate.type_name - : "暂无数据" + : '暂无数据' }} @@ -191,13 +191,15 @@ {{ formDetailValidate.type_info ? formDetailValidate.type_info - : "暂无数据" - }} {{ - formDetailValidate.margin ? formDetailValidate.margin : "暂无数据" - }} {{ formDetailValidate.create_time ? formDetailValidate.create_time - : "暂无数据" - }} {{ + >{{ formDetailValidate.update_time ? formDetailValidate.update_time - : "暂无数据" + : '暂无数据' }} @@ -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()) + } + } +} diff --git a/src/views/user/list2/index.vue b/src/views/user/list2/index.vue index 49ee8d5..feaaf1c 100644 --- a/src/views/user/list2/index.vue +++ b/src/views/user/list2/index.vue @@ -1,292 +1,177 @@