shish 1 год назад
Родитель
Сommit
fba8f3c73a

+ 4 - 1
ghsApp/src/admin/home/me.vue

@@ -87,7 +87,10 @@
             </tui-list-cell>
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/changeShop' })" class="line-cell" :hover="false" :arrow="true" v-if="getLoginInfo.lookAllShop && getLoginInfo.lookAllShop == 1" >
-              <view class="tui-title">商家列表</view>
+              <view class="tui-title">切换商家</view>
+            </tui-list-cell>
+            <tui-list-cell @click="pageTo({ url: '/admin/shop/showShop' })" class="line-cell" :hover="false" :arrow="true" v-if="getLoginInfo.lookAllShop && getLoginInfo.lookAllShop == 1" >
+              <view class="tui-title">营业商家</view>
             </tui-list-cell>
 
             <tui-list-cell @click="pageTo({ url: '/pagesClient/member/addCustom' })" class="line-cell" :hover="false" :arrow="true" v-if="getLoginInfo.lookAllShop && getLoginInfo.lookAllShop == 1" >

+ 5 - 19
ghsApp/src/admin/shop/changeShop.vue

@@ -1,9 +1,8 @@
 <template>
 <view class="app-content">
 	<view class="ex-page">
-		<view class="top-bar" style="margin-left:100upx;display: flex;align-items:center;">
-			<text @click="showAllShop">显示全部门店</text>
-			<input v-model="name" type="text" @input="searchShop" style="border:1upx solid #CCCCCC;width:300upx;margin-left:50upx;" />
+		<view class="top-bar" style="display: flex;align-items:center;">
+			<input v-model="name" type="text" @input="searchShop" style="border:1upx solid #CCCCCC;width:300upx;height:65upx;margin:0 auto;text-align:center;" />
 		</view>
 		<scroll-view scroll-y scroll-with-animation class="main-view">
 			<view class="space-view ex-table">
@@ -11,18 +10,8 @@
 					<t-table :headerBackgroundColor="'#F0F2F6'">
 						<t-tr header>
 							<t-th><view style="width:180upx;">名称</view></t-th>
-							<t-th>今天收入</t-th>
-							<t-th>可提现</t-th>
-							<t-th>花店数</t-th>
 							<t-th>操作</t-th>
 						</t-tr>
-						<t-tr>
-							<t-td><view style="width:180upx;font-weight:bold;color:black;font-size:25upx;">合计</view></t-td>
-							<t-td><view style="font-weight:bold;color:black;font-size:25upx;">{{shopData.totalSale}}</view></t-td>
-							<t-td><view style="font-weight:bold;color:black;font-size:25upx;">{{shopData.totalBalance}}</view></t-td>
-							<t-td><view style="font-weight:bold;color:black;font-size:25upx;">{{shopData.totalShopNum}}</view></t-td>
-							<t-td><view style="font-weight:bold;color:black;font-size:25upx;"></view></t-td>
-						</t-tr>
 						<t-tr v-for="(item, inIndex) in shopData.list" :key="inIndex">
 							<t-td>
 								<view style="width:180upx;">
@@ -32,10 +21,7 @@
 									</block>
 								</view>
 							</t-td>
-							<t-td><view>{{item.todaySale?parseFloat(item.todaySale):0}}</view></t-td>
-							<t-td><view>{{item.balance?parseFloat(item.balance):0}}</view></t-td>
-							<t-td><view>{{item.shopNum?parseFloat(item.shopNum):0}}</view></t-td>
-							<t-td><button class="admin-button-com mini-btn blue" style="margin-left:30upx;" @click="changeShop(item.id)">选择</button></t-td>
+							<t-td><button class="admin-button-com middle blue" style="margin-left:30upx;" @click="changeShop(item.id)">选择</button></t-td>
 						</t-tr>
 					</t-table>
 				</block>
@@ -78,7 +64,7 @@ export default {
 			}
 		},
 		showShop(){
-			getPtGhsShop({hasSale:1,pageSize:100,name:this.name}).then(res=>{
+			getPtGhsShop({hasSale:0,pageSize:100,name:this.name}).then(res=>{
 				this.shopData = res.data
 			})
 		},
@@ -124,7 +110,7 @@ export default {
 		}
 	}
 	.main-view {
-		margin-top: 80upx;
+		margin-top:90upx;
 		flex: 1;
 		background-color: #f9fbfc;
 		.space-view {

+ 180 - 0
ghsApp/src/admin/shop/showShop.vue

@@ -0,0 +1,180 @@
+<template>
+<view class="app-content">
+	<view class="ex-page">
+		<scroll-view scroll-y scroll-with-animation class="main-view">
+			<view class="space-view ex-table">
+				<block>
+					<t-table :headerBackgroundColor="'#F0F2F6'">
+						<t-tr header>
+							<t-th><view style="width:180upx;">名称</view></t-th>
+							<t-th>今天收入</t-th>
+							<t-th>可提现</t-th>
+							<t-th>花店数</t-th>
+							<t-th>操作</t-th>
+						</t-tr>
+						<t-tr>
+							<t-td><view style="width:180upx;font-weight:bold;color:black;font-size:25upx;">合计</view></t-td>
+							<t-td><view style="font-weight:bold;color:black;font-size:25upx;">{{shopData.totalSale}}</view></t-td>
+							<t-td><view style="font-weight:bold;color:black;font-size:25upx;">{{shopData.totalBalance}}</view></t-td>
+							<t-td><view style="font-weight:bold;color:black;font-size:25upx;">{{shopData.totalShopNum}}</view></t-td>
+							<t-td><view style="font-weight:bold;color:black;font-size:25upx;"></view></t-td>
+						</t-tr>
+						<t-tr v-for="(item, inIndex) in shopData.list" :key="inIndex">
+							<t-td>
+								<view style="width:180upx;">
+									<view>{{item.merchantName}}</view>
+									<block v-if="item.shopName && item.shopName !='首店'">
+										<view>{{item.shopName}}</view>
+									</block>
+								</view>
+							</t-td>
+							<t-td><view>{{item.todaySale?parseFloat(item.todaySale):0}}</view></t-td>
+							<t-td><view>{{item.balance?parseFloat(item.balance):0}}</view></t-td>
+							<t-td><view>{{item.shopNum?parseFloat(item.shopNum):0}}</view></t-td>
+							<t-td><button class="admin-button-com mini-btn blue" style="margin-left:30upx;" @click="changeShop(item.id)">in</button></t-td>
+						</t-tr>
+					</t-table>
+				</block>
+			</view>
+		</scroll-view>
+	</view>
+</view>
+</template>
+<script>
+import AppWrapperEmpty from "@/components/app-wrapper-empty";
+import { getPtGhsShop,switchGhsShop } from "@/api/shop";
+import { list } from "@/mixins";
+import {mapGetters} from "vuex";
+export default {
+	components: {AppWrapperEmpty},
+	mixins: [list],
+	computed: {		
+		...mapGetters(["getDictionariesInfo","getLoginInfo"])
+	},
+	data() {
+		return {
+			shopData:{},
+			name:''
+		};
+	},
+	methods: {
+		showAllShop(){
+			uni.showLoading()
+			getPtGhsShop({pageSize:100}).then(res=>{
+				uni.hideLoading()
+				this.shopData = res.data
+			})
+		},
+		init(){
+			this.showShop()
+		},
+		searchShop(){
+			if(!this.$util.isEmpty(this.name)){
+				this.showShop()
+			}
+		},
+		showShop(){
+			getPtGhsShop({hasSale:1,pageSize:100,name:this.name}).then(res=>{
+				this.shopData = res.data
+			})
+		},
+		changeShop(id){
+			let that = this
+			switchGhsShop({shopId:id}).then(res=>{
+				//有多处相似地方,请全项目搜索about_store_clear
+				// #ifdef MP-WEIXIN
+				that.$store.commit("setLoginInfo", {})
+				that.$util.pageTo({url: "/admin/home/workbench",type: 3})
+				// #endif
+				// #ifdef APP-PLUS
+				that.$store.commit("setLoginInfo", {})
+				that.$store.commit("setDictionariesInfo", {})
+				that.$store.commit("setMyShopInfo", {})
+				plus.runtime.restart()
+				// #endif
+			})
+		}
+	},
+};
+</script>
+<style lang="scss" scoped>
+.ex-page {
+	background: white;
+	height: 100%;
+	display: flex;
+	flex-direction: column;
+	.top-bar {
+		position: absolute;
+		left: 0;
+		display: flex;
+		width: 100%;
+		top:20upx;
+		z-index: 20;
+		.bar{
+			width: 50%;
+			height: 100%;
+			text-align: center;
+			&:nth-child(1){
+				border-right: 1upx solid #eeeeec;
+			}
+		}
+	}
+	.main-view {
+		margin-top:20upx;
+		flex: 1;
+		background-color: #f9fbfc;
+		.space-view {
+			background-color: #fff;
+		}
+		.ex-info {
+			padding: 30upx;
+			.info-cell {
+				display: flex;
+				align-items: center;
+				font-size: 28upx;
+				&:not(:first-child) {
+					margin-top: 20upx;
+				}
+				.cell-label {
+					width: 110upx;
+					color: #666666;
+				}
+				.cell-value {
+					margin-left: 40upx;
+					color: #333;
+					&.warning {
+						color: #ffaf1d;
+					}
+					&.success {
+						color: #27c325;
+					}
+				}
+			}
+		}
+		.ex-table {
+			::v-deep.icon-info {
+				color: #333333;
+			}
+		}
+	}
+	.bar-view {
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		padding: 0 30upx;
+		width: 100%;
+		height: 100upx;
+
+		box-shadow: 0upx -1upx 6upx 0upx rgba(4, 0, 0, 0.06);
+		.info-view {
+			font-size: 26upx;
+		}
+		.btn-view {
+			display: flex;
+			.admin-button-com {
+				margin: 0 10upx;
+			}
+		}
+	}
+}
+</style>

+ 2 - 1
ghsApp/src/pages.json

@@ -209,7 +209,8 @@
 				{"path": "print","style": {"navigationBarTitleText": "小票机"}},
 				{"path": "wcPrint","style": {"navigationBarTitleText": "采购小票机"}},
 				{"path": "trumpet","style": {"navigationBarTitleText": "云音箱"}},
-				{"path": "changeShop","style": {"navigationBarTitleText": "切换门店"}},
+				{"path": "changeShop","style": {"navigationBarTitleText": "切换商家"}},
+				{"path": "showShop","style": {"navigationBarTitleText": "营业商家"}},
 				{"path": "sk","style": {"navigationBarTitleText": "设置快捷开单"}},
 				{"path": "password","style": {"navigationBarTitleText": "密码修改"}},
 				{"path": "debtChange","style": {"navigationBarTitleText": "欠款变动记录"}},