lilei hai 7 meses
pai
achega
0c76610673
Modificáronse 6 ficheiros con 89 adicións e 31 borrados
  1. 1 1
      App.vue
  2. 34 0
      api/bizParam.js
  3. 1 8
      api/cart.js
  4. 23 4
      pages/index/index.vue
  5. 1 1
      pages/morePage/morePage.vue
  6. 29 17
      pagesB/shopShow/shopShow.vue

+ 1 - 1
App.vue

@@ -1,7 +1,7 @@
 <script>
 	export default {
 		globalData: {
-			baseUrl: 'http://192.168.2.100:9110/saas/clz/', // 本地
+			baseUrl: 'http://192.168.2.113:9110/saas/clz/', // 本地sss
 			// baseUrl: 'https://md.test.zyucgj.com/saas/clz/', // 预发布
 			// baseUrl: 'https://car.zyucgj.com/saas/clz/' // 生产
 		},

+ 34 - 0
api/bizParam.js

@@ -0,0 +1,34 @@
+import request from './request';
+ 
+// 商城是否开启
+export function getShopStatus(params) {
+	return request({
+	  url: `bizParam/findMallParam`,
+	  method: 'post',
+	  data: params
+	})
+}
+// 员工是否开启商城列表
+export function getShopUserParamList(params) {
+	return request({
+	  url: `bizParam/findMallUserParam`,
+	  method: 'post',
+	  data: params
+	})
+}
+// 查询本人商城状态
+export function getShopUserParam(params) {
+	return request({
+	  url: `bizParam/findMyMallParam`,
+	  method: 'post',
+	  data: params
+	})
+}
+// 更新人员商城状态
+export function updateShopUserParam(params) {
+	return request({
+	  url: `bizParam/updateMallUserParam`,
+	  method: 'post',
+	  data: params
+	})
+}

+ 1 - 8
api/cart.js

@@ -44,11 +44,4 @@ export function getCartCount(params) {
 	  data: params
 	})
 }
-// 商城是否开启
-export function getShopStatus(params) {
-	return request({
-	  url: `bizParam/findMallParam`,
-	  method: 'post',
-	  data: params
-	})
-}
+ 

+ 23 - 4
pages/index/index.vue

@@ -178,7 +178,8 @@
 	import { scanVinLogQueryRoll, getScanVinLogList, getScanGetMaxQty }from '@/api/car.js'
 	import { shopBannerList } from '@/api/video.js'
 	import { getRewardRollList } from '@/api/rewardRule.js'
-	import { getShopStatus, getCartCount } from '@/api/cart.js'
+	import { getCartCount } from '@/api/cart.js'
+	import { getShopStatus, getShopUserParam } from '@/api/bizParam.js'
 	import { getShopCategory, getShopProductList } from '@/api/shop.js'
 	import { openWebView, clickTab, toAuthStore, clickBannerList, toLogin } from "@/utils/index.js"
 	export default {
@@ -455,13 +456,31 @@
 			// 商城信息, flag: true 再次刷新,false 只加载一次
 			getHasShopping(flag){
 				getShopStatus().then(res => {
-					this.hasShopiing = res.data && res.data.paramValue == 1
+					const hasShopiing = res.data && res.data.paramValue == 1
+					// 经销商开启商城
+					if(hasShopiing){
+						// 判断员工是否开启商城
+						this.getShopUserStatus(flag)
+					}else{
+						this.hasShopiing = false
+						this.$store.state.vuex_hasShopiing = this.hasShopiing
+						// 没有商城
+						this.showNoShopPage(flag)
+						// 查询红包活动
+						this.getRedPacketRule()
+					}
+				})
+			},
+			// 员工用户是否开启商城
+			getShopUserStatus(flag){
+				getShopUserParam({}).then(res=>{
+					const item = res.data
+					this.hasShopiing = item && item.paramMap && item.paramMap.mall_flag && item.paramMap.mall_flag.paramValue == 1
 					this.$store.state.vuex_hasShopiing = this.hasShopiing
-					// 有商城
 					if(this.hasShopiing){
+						// 判断员工是否开启商城
 						this.showShopPage(flag)
 					}else{
-						// 没有商城
 						this.showNoShopPage(flag)
 					}
 					// 查询红包活动

+ 1 - 1
pages/morePage/morePage.vue

@@ -318,7 +318,7 @@
 					item.child = item.child.filter(c => c.auth)
 					item.auth = item.child.length > 0
 				})
-				return list
+				return list.filter(item => item.auth)
 			}
 		},
 		onShow() {

+ 29 - 17
pagesB/shopShow/shopShow.vue

@@ -5,17 +5,16 @@
 			<view  
 			class="check-order-list" 
 			v-for="(item,index) in list" 
-			:key="item.id" 
+			:key="item.userId" 
 			>
 				<view class="flex align_center justify_between" @click="editPerson(item)">
 					<view class="u-name">
-						<text style="margin-right: 0.5rem;">{{item.name}}</text>
-						<u-icon :name="item.sex==1?'man':'woman'" size="28" :color="item.sex==1?'#00aaff':'#ffaaaa'"></u-icon>
+						<text style="margin-right: 0.5rem;">{{item.userName}}</text>
 					</view>
 					<view class="u-mobile">
-						<text v-if="item.isManager == 1">门店负责人\ </text>
-						<text v-if="item.isManager == 0 && item.roleNames">{{item.roleNames}} / </text>
-						{{item.mobile}}
+						<text v-if="item.isManager == 1">门店负责人/ </text>
+						<text v-if="item.isManager == 0 && item.roleName">{{item.roleName}} / </text>
+						{{item.phone}}
 					</view>
 				</view>
 				<view class="set-item flex align_center justify_between">
@@ -35,7 +34,7 @@
 </template>
 
 <script>
-	import {searchEmployee, delEmployee } from '@/api/employee'
+	import {getShopUserParamList, updateShopUserParam } from '@/api/bizParam.js'
 	import moment from 'moment'
 	export default{
 		name:'personnel',
@@ -45,7 +44,7 @@
 				noDataText: '暂无数据',
 				// 查询条件
 				pageNo: 1,
-				pageSize: 20,
+				pageSize: 1000,
 				list: [],
 				total: 0,
 			}
@@ -65,26 +64,23 @@
 			// 查询列表
 			getRow (pageNo) {
 			  let _this = this
-			  if (pageNo) {
-			    this.pageNo = pageNo
-			  }
+			  const shelf = this.$store.state.vuex_storeShelf
 			  let params = {
-			    pageNo:this.pageNo,
-			    pageSize:this.pageSize
+				shelfSn: shelf.shelfSn
 			  }
 			  this.status = "loading"
-			  searchEmployee(params).then(res => {
+			  getShopUserParamList(params).then(res => {
 				if (res.code == 200 || res.status == 204 || res.status == 200) {
-				  const list = res.data.list || []
+				  const list = res.data || []
 				  list.forEach(item=>{
-					  item.show = 0
+					  item.show = item.paramMap && item.paramMap.mall_flag && item.paramMap.mall_flag.paramValue
 				  })
 				  if(_this.pageNo>1){
 					  _this.list = _this.list.concat(list)
 				  }else{
 					  _this.list = list
 				  }
-				  _this.total = res.data.count || 0
+				  _this.total = list.length || 0
 				} else {
 				  _this.list = []
 				  _this.total = 0
@@ -105,6 +101,22 @@
 			},
 			changeShow(e,item){
 				console.log(e,item)
+				uni.showLoading({
+					title: '加载中'
+				})
+				const userId = item.userId
+				const shelf = this.$store.state.vuex_storeShelf
+				updateShopUserParam({'userId':userId,'paramValue':e,shelfSn: shelf.shelfSn}).then(res=>{
+					uni.hideLoading()
+					if(res.status == 200){
+						item.show = e
+						uni.$emit("refashHome")
+					}else{
+						item.show = !e ? 1 : 0
+					}
+					this.list.splice()
+					uni.showToast(res.message)
+				})
 			}
 		}
 	}