hwq hai 1 ano
pai
achega
27b3a4ce07
Modificáronse 3 ficheiros con 45 adicións e 89 borrados
  1. 10 0
      src/api/shop.js
  2. 30 88
      src/pages/shop/shop.vue
  3. 5 1
      src/pages/shop_finance/userExtract/index.vue

+ 10 - 0
src/api/shop.js

@@ -270,4 +270,14 @@ export function merchantLoginApi(data, id) {
 		method: 'get',
 		data,
 	});
+}
+/**
+ * @description  后台-商户商品审核-开启关闭
+ */
+export function openMerchantProduct(data) {
+	return request({
+		url: `/merchant/openMerchantProduct`,
+		method: 'post',
+		data,
+	});
 }

+ 30 - 88
src/pages/shop/shop.vue

@@ -1,19 +1,10 @@
 <template>
 	<div class="article-manager">
 		<Card :bordered="false" dis-hover class="ivu-mt">
-			<Tabs class="mb20" v-model="artFrom.type" @on-click="onClickTab">
-				<TabPane :label="item.name + '(' + item.count + ')'" :name="item.type.toString()"
-					v-for="(item, index) in headeNum" :key="index" />
-			</Tabs>
 			<Form ref="artFrom" :model="artFrom" :label-width="75" label-position="right" @submit.native.prevent>
 				<Row type="flex" :gutter="24">
 					<Col v-bind="grid">
 					<FormItem label="商户分类:" label-for="merchant_category_id">
-						<!-- <Select v-model="artFrom.cate_id" placeholder="请选择商品分类" clearable @on-change="userSearchs">
-                <Option v-for="item in treeSelect" :value="item.id" :key="item.id">{{
-                  item.html + item.cate_name
-                }}</Option>
-              </Select> -->
 						<el-cascader v-model="artFrom.category_id" size="small" :options="classifySelect"
 							:props="{ emitPath: false,value:'merchant_category_id',label:'category_name' }"
 							clearable></el-cascader>
@@ -21,11 +12,6 @@
 					</Col>
 					<Col v-bind="grid">
 					<FormItem label="商户类型:" label-for="mer_type_id">
-						<!-- <Select v-model="artFrom.cate_id" placeholder="请选择商品分类" clearable @on-change="userSearchs">
-					  <Option v-for="item in treeSelect" :value="item.id" :key="item.id">{{
-					    item.html + item.cate_name
-					  }}</Option>
-					</Select> -->
 						<el-cascader v-model="artFrom.type_id" size="small" :options="typeSelect"
 							:props="{ emitPath: false ,value:'mer_type_id',label:'type_name'}" clearable></el-cascader>
 					</FormItem>
@@ -41,9 +27,8 @@
 			<div class="Button">
 				<Button type="primary" @click="add('添加')" class="bnt mr15" icon="md-add">添加商户</Button>
 			</div>
-			<Table ref="table" :columns="artFrom.type !== '1' && artFrom.type !== '2' ? columns2 : columns"
-				:data="tableList" class="ivu-mt mt25" :loading="loading" highlight-row no-data-text="暂无数据"
-				no-filtered-data-text="暂无筛选结果">
+			<Table ref="table" :columns="columns" :data="tableList" class="ivu-mt mt25" :loading="loading" highlight-row
+				no-data-text="暂无数据" no-filtered-data-text="暂无筛选结果">
 				<template slot-scope="{ row }" slot="image">
 					<div class="tabBox_img" v-viewer>
 						<img v-lazy="row.image" />
@@ -63,6 +48,14 @@
 						<span slot="close">禁用</span>
 					</i-switch>
 				</template>
+				<template slot-scope="{ row, index }" slot="is_audit">
+					<i-switch v-model="row.is_audit" :value="row.is_audit" :true-value="1" :false-value="0"
+						@on-change="changeExamineSwitch(row)" size="large">
+						<span slot="open">开启</span>
+						<span slot="close">关闭</span>
+					</i-switch>
+				</template>
+
 				<template slot-scope="{ row, index }" slot="action">
 					<!-- <a @click="onLogo(row)">登录</a>
 					<Divider type="vertical" /> -->
@@ -173,13 +166,13 @@
 		merchentlist,
 		getmerchent,
 		addadmin,
-		updataadmin,
 		changepwd,
 		lst,
 		typeList,
 		forbidden,
 		openMerchant,
-		merchantLoginApi
+		merchantLoginApi,
+		openMerchantProduct
 	} from '@/api/shop';
 	import {
 		setCookies
@@ -191,7 +184,6 @@
 		formatFlatteningRoutes,
 		findFirstNonNullChildren
 	} from '@/libs/system';
-	import SettingMer from "@/libs/settingMer";
 	export default {
 		name: 'shop_list',
 		components: {
@@ -236,7 +228,6 @@
 				},
 				list: [],
 				tableList: [],
-				headeNum: [],
 				classifySelect: [],
 				typeSelect: [],
 				loading: false,
@@ -277,8 +268,8 @@
 						minWidth: 150,
 					},
 					{
-						title: '商户简介',
-						key: 'introduction',
+						title: '审核',
+						slot: 'is_audit',
 						minWidth: 150,
 					},
 					{
@@ -318,11 +309,7 @@
 				],
 				data: [],
 				total: 0,
-				attrTemplate: false,
-				ids: [],
 				goodsId: '',
-				isProductBox: false,
-				treeSelect: [],
 				modals: false,
 				modalPic: false,
 				pwd: false,
@@ -363,16 +350,6 @@
 						message: '请输入商户名称',
 						trigger: 'blur'
 					}],
-					// category_id: [{
-					// 	required: true,
-					// 	message: '请选择商户分类',
-					// 	trigger: 'blur'
-					// }],
-					// type_id: [{
-					// 	required: true,
-					// 	message: '请选择商户类型',
-					// 	trigger: 'blur'
-					// }],
 					real_name: [{
 						required: true,
 						message: '请输入商户负责人名称',
@@ -419,7 +396,6 @@
 			this.getDataList();
 		},
 		activated() {
-			this.goodHeade();
 			// this.goodsCategory();
 			if (this.$route.fullPath === this.$routeProStr + '/product/product_list?type=5') {
 				this.getPath();
@@ -498,11 +474,6 @@
 				let expiresTimeNum = expiresTime - nowTimeNum;
 				return parseFloat(parseFloat(parseFloat(expiresTimeNum / 60) / 60) / 24);
 			},
-			//对象数组去重;
-			unique(arr) {
-				const res = new Map();
-				return arr.filter((arr) => !res.has(arr.id) && res.set(arr.id, 1));
-			},
 			getPic(pc) {
 				console.log(pc, 'info');
 				switch (this.picTit) {
@@ -531,49 +502,7 @@
 				this.artFrom.type = this.$route.query.type.toString();
 				this.getDataList();
 			},
-			freight() {
-				this.$refs.template.isTemplate = true;
-			},
-			clearAll(status) {
-				this.$refs.table.selectAll(status);
-			},
-			setChecked() {
-				//将new Set()转化为数组
-				this.ids = [...this.selectedIds];
-				// 找到绑定的table的ref对应的dom,找到table的objData对象,objData保存的是当前页的数据
-				let objData = this.$refs.table.objData;
-				for (let index in objData) {
-					if (this.selectedIds.has(objData[index].id)) {
-						objData[index]._isChecked = true;
-					}
-				}
-			},
-			// tab选择
-			onClickTab(name) {
-				this.artFrom.type = name;
-				this.columns2 = [...this.columns];
-				if (name !== '1' && name !== '2') {
-					this.columns2.shift({
-						type: 'selection',
-						width: 60,
-						align: 'center',
-					});
-				}
-				this.artFrom.page = 1;
-				this.selectedIds.clear();
-				this.getDataList();
-			},
-			// 获取商品表单头数量
-			goodHeade() {
-				getGoodHeade()
-					.then((res) => {
-						this.headeNum = res.data.list;
-					})
-					.catch((res) => {
-						this.$Message.error(res.msg);
-					});
-			},
-			// 商品分类;
+			// 商户类型;
 			gettype() {
 				console.log('进入');
 				typeList()
@@ -584,7 +513,7 @@
 						this.$Message.error(res.msg);
 					});
 			},
-			// 商分类;
+			// 商分类;
 			getclassify() {
 				console.log('进入');
 				lst()
@@ -653,6 +582,20 @@
 						this.$Message.error(res.msg);
 					});
 			},
+			// 商户审核开启关闭
+			changeExamineSwitch(row) {
+				openMerchantProduct({
+						mer_id: row.mer_id,
+						is_audit: row.is_audit
+					})
+					.then((res) => {
+						this.$Message.success(res.msg);
+					})
+					.catch((res) => {
+						row.is_show = !row.is_show ? 1 : 0;
+						this.$Message.error(res.msg);
+					});
+			},
 			// 编辑
 			edit(row) {
 				this.$modalForm(getmerchent({}, row.mer_id)).then(() => this.getDataList());
@@ -700,7 +643,6 @@
 					.then((res) => {
 						this.$Message.success(res.msg);
 						this.tableList.splice(num, 1);
-						this.goodHeade();
 					})
 					.catch((res) => {
 						this.$Message.error(res.msg);

+ 5 - 1
src/pages/shop_finance/userExtract/index.vue

@@ -51,9 +51,11 @@
 					</Col>
 				</Row>
 			</Form>
-			<div class="Button">
+			<div class="Button" style="display: flex; justify-content: flex-start; align-items: center;">
 				<Button type="primary" @click="add('添加')" class="bnt mr15" icon="md-add">申请提现</Button>
+				<div>可提现金额:{{allmoney}}</div>
 			</div>
+			
 			<Table ref="table" :columns="columns"
 				:data="tableList" class="ivu-mt mt25" :loading="loading" highlight-row no-data-text="暂无数据"
 				no-filtered-data-text="暂无筛选结果">
@@ -156,6 +158,7 @@
 		},
 		data() {
 			return {
+				allmoney:'',
 				template: false,
 				grid: {
 					xl: 7,
@@ -258,6 +261,7 @@
 						let data = res.data;
 						this.tableList = data.list;
 						this.total = data.count;
+						this.allmoney = +data.mer_price.mer_money
 						// this.$nextTick(() => {
 						// 	//确保dom加载完毕
 						// 	this.setChecked();