diff --git a/src/views/merchant/list/index.vue b/src/views/merchant/list/index.vue index 1bcfac9..3969011 100644 --- a/src/views/merchant/list/index.vue +++ b/src/views/merchant/list/index.vue @@ -5,86 +5,30 @@
- - {{ itemn.text }} + + {{ itemn.text }} - + - - - + + + - + - - + + - - + + @@ -102,33 +46,17 @@ :value="item.code" /> --> - - + + - - + +
添加商户 - + - 登录 + 登录 编辑 - 修改管理员密码 - 删除 - 设置第三方平台商品复制次数 + 修改管理员密码 + 删除 + 设置第三方平台商品复制次数 - + - + - + - + - + - + - +
- - + + - - + +
- - +
+ + + + + +
- + - +
@@ -338,67 +192,26 @@ - +
- + - + - - + + - + - +
@@ -457,14 +270,15 @@ export default { mer_name: "", //店铺名称 category_id: "", //商品分类 type_id: "", - first_margin:'',//首次支付缴纳保证金 info: "", //区 info1: "", //街道 info2: "", //村 area_id: "", //区code street_id: "", //街道code village_id: "", //村id - paid_margin: "", //已支付的保证金 + paid_margin: "", //已缴纳的保证金 + margin: "", //需缴纳保证金 + ot_margin: "", //总的保证金额度 auto_margin_rate: "", //自动扣除保证金比例 options: [], options1: [], @@ -492,9 +306,9 @@ export default { { required: true, message: "请输入商户名称", trigger: "blur" }, { min: 1, max: 30, message: "长度在 1 到 30 个字符", trigger: "blur" } ], - category_id: [ - { required: true, message: "请选择商户分类", trigger: "change" } - ], + // category_id: [ + // { required: true, message: "请选择商户分类", trigger: "change" } + // ], type_id: [ { required: true, message: "请选择商户类型", trigger: "change" } ], @@ -541,19 +355,18 @@ export default { is_trader: "", category_id: "", type_id: "", - area_id:'', - street_id:'' + area_id: '', + street_id: '' }, autoUpdate: true, timeVal: [], - edit:0 }; - + }, created() { this.getshopList(); }, - beforeMount() {}, + beforeMount() { }, mounted() { this.getHeadNum(); this.getMerCategory(); @@ -662,7 +475,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); @@ -676,7 +493,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); @@ -705,7 +526,7 @@ export default { console.log(value); }, //获取商户分类 - getShopClassify() {}, + getShopClassify() { }, //获取商圈 async getshopList() { const data = { city_code: "510500" }; @@ -748,13 +569,12 @@ export default { }, // 获取开启商户数 getHeadNum() { - console.log('2222222222222') merchantCountApi() .then(res => { this.headeNum[0]["count"] = res.data.valid; this.headeNum[1]["count"] = res.data.invalid; }) - .catch(res => {}); + .catch(res => { }); }, // 商户分类; getMerCategory() { @@ -829,16 +649,26 @@ export default { // 添加 onAdd() { this.add = true; - this.edit=0 + this.edit = 0; 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) { - this.edit=1 //调用获取商圈 this.popFormVisible = true; //开启编辑表单 this.add = false; + this.edit = 1; const promise = await merchantUpdateApi(id); console.log("promise", promise); console.log(this.form); @@ -846,7 +676,6 @@ export default { this.merid = res.mer_id; this.form.mer_name = res.mer_name; //商户名称 this.form.category_id = res.category_id; - this.form.first_margin=res.first_margin; this.form.type_id = res.type_id; this.form.mer_account = res.mer_account; this.form.mer_password = res.mer_password; @@ -854,6 +683,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;