备注信息

This commit is contained in:
weipengfei 2023-09-27 16:19:59 +08:00
parent b14e043f83
commit 2f0f405bdd
3 changed files with 290 additions and 90 deletions

View File

@ -7,10 +7,12 @@ ENV = 'development'
#VUE_APP_BASE_API = 'https://mer1.crmeb.net'
VUE_APP_BASE_API = 'https://crmeb-test.shop.lihaink.cn'
# VUE_APP_BASE_API = 'http://192.168.1.10:8324'
# VUE_APP_BASE_API = 'http://192.168.0.108:8325'
#VUE_APP_BASE_API_Two = 'https://nk.lihaink.cn'
VUE_APP_BASE_API_Two = 'https://crmeb-test.shop.lihaink.cn'
# VUE_APP_BASE_API_Two = 'http://192.168.1.10:8324'
# socket 连接地址
#VUE_APP_WS_URL = 'ws://0.0.0.0:8324'
VUE_APP_WS_URL = 'ws://mer1.crmeb.net'

View File

@ -65,7 +65,7 @@
"lowdb": "^1.0.0",
"moment": "^2.29.1",
"monaco-editor": "^0.19.3",
"node-sass": "^4.13.1",
"node-sass": "^4.14.1",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
@ -94,7 +94,7 @@
"@vue/cli-plugin-babel": "3.5.3",
"@vue/cli-plugin-eslint": "^3.9.1",
"@vue/cli-plugin-unit-jest": "3.5.3",
"@vue/cli-service": "3.5.3",
"@vue/cli-service": "^3.5.3",
"@vue/test-utils": "1.0.0-beta.29",
"autoprefixer": "^9.5.1",
"babel-core": "7.0.0-bridge.0",

View File

@ -11,10 +11,11 @@
@change="selectChange(tableFrom.date)"
>
<el-radio-button
v-for="(itemn,indexn) in fromList.fromTxt"
v-for="(itemn, indexn) in fromList.fromTxt"
:key="indexn"
:label="itemn.val"
>{{ itemn.text }}</el-radio-button>
>{{ itemn.text }}</el-radio-button
>
</el-radio-group>
<el-date-picker
v-model="timeVal"
@ -28,7 +29,11 @@
@change="onchangeTime"
/>
</el-form-item>
<el-form-item label="关键字:" label-width="80px" style="display: inline-block;">
<el-form-item
label="关键字:"
label-width="80px"
style="display: inline-block"
>
<el-input
v-model="tableFrom.keyword"
@keyup.enter.native="getList(1)"
@ -102,24 +107,34 @@
:value="item.code"
/>
</el-select> -->
<el-cascader v-model="tableFrom.area_id" :options="form.options" @change="handleChange1"></el-cascader>
<el-cascader v-model="tableFrom.street_id" :options="form.options1" @change="getList(1)"></el-cascader>
<el-cascader
v-model="tableFrom.area_id"
:options="form.options"
@change="handleChange1"
></el-cascader>
<el-cascader
v-model="tableFrom.street_id"
:options="form.options1"
@change="getList(1)"
></el-cascader>
</el-form-item>
<el-tabs
v-if="headeNum.length > 0"
v-model="tableFrom.status"
@tab-click="getList(1),getHeadNum()"
@tab-click="getList(1), getHeadNum()"
>
<el-tab-pane
v-for="(item,index) in headeNum"
v-for="(item, index) in headeNum"
:key="index"
:name="item.type.toString()"
:label="item.title +'('+item.count +')' "
:label="item.title + '(' + item.count + ')'"
/>
</el-tabs>
</el-form>
</div>
<el-button size="small" type="primary" @click="onAdd">添加商户</el-button>
<el-button size="small" type="primary" @click="onAdd"
>添加商户</el-button
>
</div>
<el-table
v-loading="listLoading"
@ -166,7 +181,13 @@
<el-table-column prop="create_time" label="创建时间" min-width="150" />
<el-table-column prop="margin" label="保证金" min-width="150">
<template slot-scope="scope">
<span>{{scope.row.is_margin == 1 ? '未支付' : scope.row.is_margin == 0 ? '无' : '已支付'}}</span>
<span>{{
scope.row.is_margin == 1
? "未支付"
: scope.row.is_margin == 0
? "无"
: "已支付"
}}</span>
</template>
</el-table-column>
<el-table-column prop="sort" label="排序" min-width="100" />
@ -184,7 +205,12 @@
/>
</template>
</el-table-column>
<el-table-column label="操作" min-width="280" fixed="right" align="center">
<el-table-column
label="操作"
min-width="280"
fixed="right"
align="center"
>
<template slot-scope="scope">
<!-- <router-link
v-if="tableFrom.status === '1'"
@ -197,26 +223,35 @@
type="text"
size="small"
@click="onLogo(scope.row.mer_id)"
>登录</el-button>
<el-button type="text" size="small" @click="onEdit(scope.row.mer_id)">编辑</el-button>
>登录</el-button
>
<el-button
type="text"
size="small"
@click="onEdit(scope.row.mer_id)"
>编辑</el-button
>
<el-button
v-if="tableFrom.status === '1'"
type="text"
size="small"
@click="onPassword(scope.row.mer_id)"
>修改管理员密码</el-button>
>修改管理员密码</el-button
>
<el-button
v-if="tableFrom.status === '0'"
type="text"
size="small"
@click="handleDelete(scope.row.mer_id, scope.$index)"
>删除</el-button>
>删除</el-button
>
<el-button
v-if="tableFrom.status === '1'"
type="text"
size="small"
@click="handleTimes(scope.row.mer_id)"
>设置第三方平台商品复制次数</el-button>
>设置第三方平台商品复制次数</el-button
>
<!-- <el-button
v-if="tableFrom.status === '1'"
type="text"
@ -239,12 +274,28 @@
</div>
</el-card>
<!-- 添加商户弹出层 -->
<el-dialog title="添加商品" :visible.sync="popFormVisible" @close="close('form')">
<el-dialog
title="添加商品"
:visible.sync="popFormVisible"
@close="close('form')"
>
<el-form :model="form" :rules="rules" ref="form">
<el-form-item label="商户名称" :label-width="formLabelWidth" prop="mer_name">
<el-input v-model="form.mer_name" autocomplete="off" placeholder="请输入商户名称"></el-input>
<el-form-item
label="商户名称"
:label-width="formLabelWidth"
prop="mer_name"
>
<el-input
v-model="form.mer_name"
autocomplete="off"
placeholder="请输入商户名称"
></el-input>
</el-form-item>
<el-form-item label="商户分类" :label-width="formLabelWidth" prop="category_id">
<el-form-item
label="商户分类"
:label-width="formLabelWidth"
prop="category_id"
>
<el-select v-model="form.category_id" placeholder="请选择商户分类">
<el-option
:label="item.label"
@ -254,7 +305,11 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="店铺类型" :label-width="formLabelWidth" prop="type_id">
<el-form-item
label="店铺类型"
:label-width="formLabelWidth"
prop="type_id"
>
<el-select v-model="form.type_id" placeholder="请选择店铺类型">
<el-option
:label="item.label"
@ -265,15 +320,27 @@
</el-select>
</el-form-item>
<el-form-item label="商圈" :label-width="formLabelWidth">
<el-cascader v-model="form.info" :options="form.options" @change="handleChange1"></el-cascader>
<el-cascader v-model="form.info1" :options="form.options1" @change="handleChange2"></el-cascader>
<el-cascader
v-model="form.info2 "
v-model="form.info"
:options="form.options"
@change="handleChange1"
></el-cascader>
<el-cascader
v-model="form.info1"
:options="form.options1"
@change="handleChange2"
></el-cascader>
<el-cascader
v-model="form.info2"
:options="form.options2"
@change="handleChange3($event,form.options2)"
@change="handleChange3($event, form.options2)"
></el-cascader>
</el-form-item>
<el-form-item label="商户账号" :label-width="formLabelWidth" prop="mer_account">
<el-form-item
label="商户账号"
:label-width="formLabelWidth"
prop="mer_account"
>
<el-input
v-model="form.mer_account"
autocomplete="off"
@ -281,7 +348,11 @@
:disabled="!add"
></el-input>
</el-form-item>
<el-form-item label="登陆密码" :label-width="formLabelWidth" prop="mer_password">
<el-form-item
label="登陆密码"
:label-width="formLabelWidth"
prop="mer_password"
>
<el-input
v-model="form.mer_password"
autocomplete="off"
@ -290,20 +361,68 @@
></el-input>
</el-form-item>
<div class="dis">
<el-form-item label="已支付的保证金" :label-width="formLabelWidth" class="mer_phone">
<el-form-item
label="保证金额度"
:label-width="formLabelWidth"
class="mer_phone"
>
<el-input
v-model="form.paid_margin"
style="width:200px"
v-model="form.ot_margin"
style="width: 200px"
autocomplete="off"
placeholder="请输入已支付的保证金"
disabled
placeholder="保证金额度"
></el-input>
</el-form-item>
<el-form-item label="自动扣除保证金比例" :label-width="formLabelWidth" prop="commission_rate">
<el-input v-model="form.auto_margin_rate" style="width:200px" autocomplete="off"></el-input>
<el-form-item
label="已缴纳的保证金"
:label-width="formLabelWidth"
class="mer_phone"
>
<el-input
v-model="form.paid_margin"
style="width: 200px"
autocomplete="off"
disabled
placeholder="已缴纳的保证金"
></el-input>
</el-form-item>
</div>
<el-form-item label="商户姓名" :label-width="formLabelWidth" prop="real_name">
<el-input v-model="form.real_name" autocomplete="off" placeholder="请输入商户姓名"></el-input>
<div class="dis">
<el-form-item
label="需缴纳的保证金"
:label-width="formLabelWidth"
class="mer_phone"
>
<el-input
v-model="form.margin"
style="width: 200px"
autocomplete="off"
placeholder="请输入需缴纳的保证金"
></el-input>
</el-form-item>
<el-form-item
label="自动扣除保证金比例"
:label-width="formLabelWidth"
prop="commission_rate"
>
<el-input
v-model="form.auto_margin_rate"
style="width: 200px"
autocomplete="off"
></el-input>
</el-form-item>
</div>
<el-form-item
label="商户姓名"
:label-width="formLabelWidth"
prop="real_name"
>
<el-input
v-model="form.real_name"
autocomplete="off"
placeholder="请输入商户姓名"
></el-input>
</el-form-item>
<div class="dis">
<el-form-item
@ -312,9 +431,17 @@
prop="mer_phone"
class="mer_phone"
>
<el-input v-model="form.mer_phone" autocomplete="off" placeholder="请输入商户手机号"></el-input>
<el-input
v-model="form.mer_phone"
autocomplete="off"
placeholder="请输入商户手机号"
></el-input>
</el-form-item>
<el-form-item label="手续费(%)" :label-width="formLabelWidth" prop="commission_rate">
<el-form-item
label="手续费(%)"
:label-width="formLabelWidth"
prop="commission_rate"
>
<el-input-number
v-model="form.commission_rate"
@change="handleChange"
@ -325,14 +452,38 @@
></el-input-number>
</el-form-item>
</div>
<el-form-item label="商户关键字" :label-width="formLabelWidth" prop="mer_keyword">
<el-input v-model="form.mer_keyword" autocomplete="off" placeholder="请输入商户关键字"></el-input>
<el-form-item
label="商户关键字"
:label-width="formLabelWidth"
prop="mer_keyword"
>
<el-input
v-model="form.mer_keyword"
autocomplete="off"
placeholder="请输入商户关键字"
></el-input>
</el-form-item>
<el-form-item label="商户地址" :label-width="formLabelWidth" prop="mer_address">
<el-input v-model="form.mer_address" autocomplete="off" placeholder="请输入商户地址"></el-input>
<el-form-item
label="商户地址"
:label-width="formLabelWidth"
prop="mer_address"
>
<el-input
v-model="form.mer_address"
autocomplete="off"
placeholder="请输入商户地址"
></el-input>
</el-form-item>
<el-form-item label="微信分账商户号" :label-width="formLabelWidth" prop="sub_mchid">
<el-input v-model="form.sub_mchid" autocomplete="off" placeholder="请输入微信分账商户号"></el-input>
<el-form-item
label="微信分账商户号"
:label-width="formLabelWidth"
prop="sub_mchid"
>
<el-input
v-model="form.sub_mchid"
autocomplete="off"
placeholder="请输入微信分账商户号"
></el-input>
</el-form-item>
<el-form-item label="备注" :label-width="formLabelWidth" prop="mark">
<el-input
@ -344,10 +495,20 @@
></el-input>
</el-form-item>
<el-form-item label="排序" :label-width="formLabelWidth" prop="sort">
<el-input-number v-model="form.sort" @change="handleChange" :min="0" :max="10"></el-input-number>
<el-input-number
v-model="form.sort"
@change="handleChange"
:min="0"
:max="10"
></el-input-number>
</el-form-item>
<div class="switch_btn">
<el-form-item class="mini_btn" label="直播间审核" prop="value1" :label-width="formLabelWidth">
<el-form-item
class="mini_btn"
label="直播间审核"
prop="value1"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value1"
active-color="#3390ff"
@ -356,7 +517,12 @@
inactive-color="#DCDFE6"
></el-switch>
</el-form-item>
<el-form-item class="mini_btn" label="产品审核" prop="value2" :label-width="formLabelWidth">
<el-form-item
class="mini_btn"
label="产品审核"
prop="value2"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value2"
active-color="#3390ff"
@ -379,7 +545,12 @@
inactive-color="#DCDFE6"
></el-switch>
</el-form-item>
<el-form-item class="mini_btn" label="是否推荐" prop="value4" :label-width="formLabelWidth">
<el-form-item
class="mini_btn"
label="是否推荐"
prop="value4"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value4"
active-color="#3390ff"
@ -388,7 +559,12 @@
inactive-color="#DCDFE6"
></el-switch>
</el-form-item>
<el-form-item class="mini_btn" label="是否自营" prop="value5" :label-width="formLabelWidth">
<el-form-item
class="mini_btn"
label="是否自营"
prop="value5"
:label-width="formLabelWidth"
>
<el-switch
v-model="form.value5"
active-color="#3390ff"
@ -444,7 +620,7 @@ import SettingMer from "@/libs/settingMer";
import Cookies from "js-cookie";
export default {
name: "MerchantList",
data() {
data () {
return {
add: true,
//
@ -460,7 +636,9 @@ export default {
area_id: "", //code
street_id: "", //code
village_id: "", //id
paid_margin: "", //
paid_margin: "", //
margin: "", //
ot_margin: "", //
auto_margin_rate: "", //
options: [],
options1: [],
@ -537,32 +715,32 @@ export default {
is_trader: "",
category_id: "",
type_id: "",
area_id:'',
street_id:''
area_id: '',
street_id: ''
},
autoUpdate: true,
timeVal: [],
};
},
created() {
created () {
this.getshopList();
},
beforeMount() {},
mounted() {
beforeMount () { },
mounted () {
this.getHeadNum();
this.getMerCategory();
this.getStoreType();
this.getList("");
},
methods: {
close(formName) {
close (formName) {
this.resetForm(formName);
},
handleChange(value) {
handleChange (value) {
// console.log(value);
},
async handleChange1(value) {
async handleChange1 (value) {
console.log(value);
const data = { area_code: value[0] };
const promise = await getShopAddressApi_two(data);
@ -574,7 +752,7 @@ export default {
}
console.log(this.form.info1);
},
async handleChange2(value, ID) {
async handleChange2 (value, ID) {
console.log(value, ID);
if (value !== value) {
this.form.info2 = 0;
@ -587,7 +765,7 @@ export default {
}
this.form.options2 = promise.data;
},
handleChange3(e, val) {
handleChange3 (e, val) {
// let id=''
// for(let item of val){
// if(item.code==e){
@ -613,17 +791,17 @@ export default {
// this.form.street_id = this.form.info1[0]
// this.form.village_id = id
},
open4(err) {
open4 (err) {
this.$message.error(err);
},
open2(sus) {
open2 (sus) {
this.$message({
message: sus,
type: "success"
});
},
//
submitForm(formName) {
submitForm (formName) {
console.log("1------------------1");
this.$refs[formName].validate(async valid => {
if (valid) {
@ -657,7 +835,11 @@ export default {
if (this.add) {
//--merchantCreate
try {
const res = await merchantCreate(this.form);
let f_data = JSON.parse(JSON.stringify(this.form));
delete f_data.options;
delete f_data.options1;
delete f_data.options2;
const res = await merchantCreate(f_data);
console.log("res", res);
if (res.status == 200) {
this.open2(res.message);
@ -671,7 +853,11 @@ export default {
try {
console.log(this.form);
console.log("id", this.merid);
const res = await merchantUpdateA(this.merid, this.form);
let f_data = JSON.parse(JSON.stringify(this.form));
delete f_data.options;
delete f_data.options1;
delete f_data.options2;
const res = await merchantUpdateA(this.merid, f_data);
console.log("res", res);
if (res.status == 200) {
this.open2(res.message);
@ -689,20 +875,20 @@ export default {
});
},
//
resetForm(formName) {
resetForm (formName) {
this.$nextTick(() => {
this.$refs[formName].resetFields();
});
// this.$refs[formName].resetFields();
},
//
handleChange(value) {
handleChange (value) {
console.log(value);
},
//
getShopClassify() {},
getShopClassify () { },
//
async getshopList() {
async getshopList () {
const data = { city_code: "510500" };
const promise = await getShopAddressApi(data).then(
res => {
@ -717,7 +903,7 @@ export default {
}
);
},
onLogo(id) {
onLogo (id) {
merchantLoginApi(id)
.then(res => {
Cookies.set("merchantToken", res.data.token);
@ -728,30 +914,30 @@ export default {
});
},
//
selectChange(tab) {
selectChange (tab) {
this.tableFrom.date = tab;
this.timeVal = [];
this.tableFrom.page = 1;
this.getList("");
},
//
onchangeTime(e) {
onchangeTime (e) {
this.timeVal = e;
this.tableFrom.date = this.timeVal ? this.timeVal.join("-") : "";
this.tableFrom.page = 1;
this.getList("");
},
//
getHeadNum() {
getHeadNum () {
merchantCountApi()
.then(res => {
this.headeNum[0]["count"] = res.data.valid;
this.headeNum[1]["count"] = res.data.invalid;
})
.catch(res => {});
.catch(res => { });
},
//
getMerCategory() {
getMerCategory () {
getMerCateApi()
.then(res => {
this.merCateList = res.data;
@ -760,7 +946,7 @@ export default {
this.$message.error(res.message);
});
},
getStoreType() {
getStoreType () {
getstoreTypeApi()
.then(res => {
this.storeType = res.data;
@ -770,7 +956,7 @@ export default {
});
},
//
getList(num) {
getList (num) {
console.log(this.tableFrom);
this.listLoading = true;
this.tableFrom.page = num ? num : this.tableFrom.page;
@ -787,16 +973,16 @@ export default {
this.$message.error(res.message);
});
},
pageChange(page) {
pageChange (page) {
this.tableFrom.page = page;
this.getList("");
},
handleSizeChange(val) {
handleSizeChange (val) {
this.tableFrom.limit = val;
this.getList(1);
},
//
onchangeIsShow(row) {
onchangeIsShow (row) {
const title = row.is_best === 0 ? "是否开启推荐商户" : "是否关闭推荐商户";
this.$modalSure(title).then(() => {
merchantStatuseApi(row.mer_id, row.is_best === 1 ? 0 : 1)
@ -810,7 +996,7 @@ export default {
});
},
//
onchangeIsClose(row) {
onchangeIsClose (row) {
merchantIsCloseApi(row.mer_id, row.status === 1 ? 0 : 1)
.then(({ message }) => {
this.$message.success(message);
@ -821,13 +1007,23 @@ export default {
});
},
//
onAdd() {
onAdd () {
this.add = true;
this.popFormVisible = true;
this.form.auto_margin_rate = 0; //
this.form.paid_margin = "0.00"; //
this.form.ot_margin = "0.00"; //
this.form.margin = ""; //
this.form.area_id = "";
this.form.street_id = "";
this.form.village_id = "";
this.form.info = "";
this.form.info1 = "";
this.form.info2 = "";
// this.$modalForm(merchantCreateApi()).then(() => this.getList(""));
},
//
async onEdit(id) {
async onEdit (id) {
//
this.popFormVisible = true; //
this.add = false;
@ -845,6 +1041,8 @@ export default {
this.form.mer_phone = res.mer_phone;
this.form.auto_margin_rate = res.auto_margin_rate; //
this.form.paid_margin = res.paid_margin; //
this.form.ot_margin = res.ot_margin; //
this.form.margin = res.margin; //
this.form.area_id = res.geo_address.area_id;
this.form.street_id = res.geo_address.street_id;
this.form.village_id = res.geo_address.village_id;
@ -894,7 +1092,7 @@ export default {
// this.$modalForm(merchantUpdateApi(id)).then(() => this.getList(""));
},
//
handleDelete(id) {
handleDelete (id) {
this.$modalSure(
"该商户下有相关数据信息,删除后不可恢复,您是否确定删除"
).then(() => {
@ -910,16 +1108,16 @@ export default {
});
},
//
onDeduct(id) {
onDeduct (id) {
this.$modalForm(marginDeductionForm(id)).then(() => this.getList(""));
},
//
handleTimes(id) {
handleTimes (id) {
this.$modalForm(changeCopyApi(id)).then(() => this.getList(""));
},
//
onPassword(id) {
onPassword (id) {
this.$modalForm(merchantPasswordApi(id));
}
}