Pārlūkot izejas kodu

commit -m 收款工具

zhengjinyi 3 gadi atpakaļ
vecāks
revīzija
c4dd846c0b

+ 0 - 1
App.vue

@@ -5,7 +5,6 @@
 	import Vue from 'vue'
 	import { mapState,mapMutations} from 'vuex'
 	import authorize from '@/common/config/authorize.js'
-	import wxLogin from '@/services/wxLogin.js'
 	export default {
 		onLaunch: function() {
 			let self = this

+ 1 - 2
pages/collection/detail.vue

@@ -36,7 +36,7 @@
 				<view class="section-rows">
 					<view class="rows-label">手续费:</view>
 					<view class="rows-mains">
-						<text>¥{{ receipt.handlingFee ? (receipt.handlingFee | NumFormat) : '0.00' }}</text>
+						<text>¥{{ receipt.handlingFee | NumFormat }}</text>
 					</view>
 				</view>
 				<view class="section-title">收款短信</view>
@@ -51,7 +51,6 @@
 	</view>
 </template>
 <script>
-	import wxLogin from '@/services/wxLogin.js'
 	import {
 		mapState,
 		mapMutations

+ 22 - 55
pages/collection/list.vue

@@ -83,7 +83,7 @@
 								<text class="iconfont icon-fenxiang"></text>
 							</button>
 							<!-- 底部button -->
-							<list-button ref="listButton" :status="receipt.receiptStatus" :dataInfo="receipt" v-if="USER_TYPE!=1"
+							<list-button ref="listButton" :status="receipt.receiptStatus" :dataInfo="receipt" v-if="handlebBtnVisible"
 								@buttonConfirm="handButtonConfirm">
 							</list-button>
 						</view>
@@ -96,7 +96,7 @@
 			</view>
 		</view>
 		<!-- 口头返佣按钮 -->
-		<view class="tui-icon-button" v-if="currents == 2" @click="toNoSms('/pages/relation/return/list')">
+		<view class="tui-icon-button" v-if="currents == 2 && returnBtnVisible" @click="toNoSms('/pages/relation/return/list')">
 			<text class="iconfont icon-jiahao"></text>
 		</view>
 		<!--右抽屉-->
@@ -160,7 +160,12 @@
 	import listButton from '@/components/cm-module/orderDetails/list-button' //按钮
 	import modalLayer from '@/components/modal-layer'
 	import empty from '@/components/empty'
-	import wxLogin from '@/services/wxLogin.js'
+	import { 
+		defaultAllTabs,
+		defaultServiceTabs ,
+		listTabsType,
+		listReturnType
+	} from '@/utils/config.tabs.js'
 	import {
 		mapState,
 		mapMutations
@@ -187,50 +192,9 @@
 				CustomBar: this.CustomBar, // 顶部导航栏高度
 				isIphoneX: this.$store.state.isIphoneX,
 				skeletonShow:true,
-				listTabs: [{//收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
-						name: '订单',
-						type: 1
-					},
-					{
-						name: '非订单',
-						type: 2
-					},
-					{
-						name: '返佣',
-						type: 3
-					},
-					{
-						name: '供应商退款',
-						type: 5
-					}
-				],
-				listTabsType: [{//收款状态:0全部 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
-						name: '全部',
-						type: 0
-					},
-					{
-						name: '待确认',
-						type: 1
-					},
-					{
-						name: '待审核',
-						type: 2
-					},
-					{
-						name: '审核通过',
-						type: 3
-					}
-				],
-				listReturnType: [{//收款状态:0全部 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
-					name: '全部',
-					type: 0
-				}, {
-					name: '待确认',
-					type: 1
-				}, {
-					name: '已确认',
-					type: 2
-				}],
+				listTabs: [],// 收款款项类型
+				listTabsType: listTabsType, //收款状态:
+				listReturnType: listReturnType, //收款状态:
 				date: currentDate,
 				currents: 0,
 				tabCurrents: 0,
@@ -274,17 +238,22 @@
 			})
 		},
 		computed: {
-			...mapState(['hasLogin','USER_TYPE']),
+			...mapState(['USER_TYPE','handlebBtnVisible','returnBtnVisible']),
 			startDate() {
 				return this.getDate('start')
 			},
 			endDate() {
 				return this.getDate('end')
-			}
+			},
+			
 		},
 		methods: {
 			async initGetStotage() {
-				console.log('USER_TYPE',this.USER_TYPE)
+				if(this.USER_TYPE === 2){
+					this.listTabs = defaultServiceTabs
+				}else{
+					this.listTabs = defaultAllTabs
+				}
 				this.getOrderDatainit()
 			},
 			getOrderDatainit() {
@@ -306,6 +275,7 @@
 							} else {
 								if (this.payList.length < 4) {
 									this.pullUpOn = true
+									this.loadding = false
 								} else {
 									this.pullUpOn = false
 									this.loadding = false
@@ -348,18 +318,13 @@
 				})
 			},
 			receiptDetail(receipt) {
-				console.log('this.tabCurrents',this.tabCurrents)
-				console.log('this.receipt',receipt.receiptType)
 				switch(receipt.receiptType){
 					case 1:// 1:订单 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
 						if(receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5){// 订单待确认
-							console.log('订单待确认')
 							this.$api.navigateTo(`/pages/relation/ordinary/index?id=${receipt.id}`)
 						}else if(receipt.receiptStatus == 2){// 待审核
-							console.log('待审核')
 							this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?id=${receipt.id}`)
 						}else if(receipt.receiptStatus == 3){// 审核通过
-							console.log('审核通过')
 							this.$api.navigateTo(`/pages/relation/ordinary/detail?id=${receipt.id}`)
 						}
 						break
@@ -545,6 +510,7 @@
 						this.listQuery.receiptStatus = 0
 						this.listQuery.startDate = ''
 						this.listQuery.endDate = ''
+						this.listQuery.smsContent = ''
 						this.getOrderDatainit()
 						this.tabCurrents = 0
 						break
@@ -554,6 +520,7 @@
 						this.tabCurrents = index
 						this.listQuery.startDate = ''
 						this.listQuery.endDate = ''
+						this.listQuery.smsContent = ''
 						this.listQuery.receiptStatus = type
 						this.getOrderDatainit()
 				}

+ 0 - 1
pages/collection/nosms.vue

@@ -89,7 +89,6 @@
 <script>
 	import statistic_bg2 from '@/static/temp/statistic_bg2.png'
 	import statistic_bg1 from '@/static/temp/statistic_bg1.png'
-	import wxLogin from '@/services/wxLogin.js'
 	import {
 		mapState,
 		mapMutations

+ 0 - 1
pages/collection/sms.vue

@@ -176,7 +176,6 @@
 	</view>
 </template>
 <script>
-import wxLogin from '@/services/wxLogin.js'
 import { mapState, mapMutations } from 'vuex'
 const defaultParams = {
 	smsContent: '', // 收款短信

+ 0 - 1
pages/relation/nonorder/detail.vue

@@ -111,7 +111,6 @@
 	</view>
 </template>
 <script>
-import wxLogin from '@/services/wxLogin.js'
 import receiptDetails from '@/components/cm-module/receipt/receipt-details'
 import { mapState, mapMutations } from 'vuex'
 

+ 0 - 1
pages/relation/order/detail.vue

@@ -162,7 +162,6 @@
 	</view>
 </template>
 <script>
-import wxLogin from '@/services/wxLogin.js'
 import { mapState, mapMutations } from 'vuex'
 
 export default {

+ 0 - 1
pages/relation/ordinary/detail.vue

@@ -104,7 +104,6 @@
 	</view>
 </template>
 <script>
-import wxLogin from '@/services/wxLogin.js'
 import receiptDetails from '@/components/cm-module/receipt/receipt-details'
 import { mapState, mapMutations } from 'vuex'
 

+ 3 - 7
pages/relation/ordinary/examine-detail.vue

@@ -90,7 +90,7 @@
 				<view class="section-tips">注:款项和订单已确认关联,等待审核</view>
 			</view>
 		</view>
-		<view class="distinguish-button" :style="{ paddingBottom: isIphoneX ? '68rpx' : '24rpx' }">
+		<view class="distinguish-button" v-if="examineBtnVisible" :style="{ paddingBottom: isIphoneX ? '68rpx' : '24rpx' }">
 			<view class="button cancel" @click="confirmDistinguish(2)">不通过</view>
 			<view class="button confirm" @click="confirmDistinguish(1)">通过</view>
 		</view>
@@ -118,7 +118,6 @@
 	</view>
 </template>
 <script>
-	import wxLogin from '@/services/wxLogin.js'
 	import receiptDetails from '@/components/cm-module/receipt/receipt-details'
 	import {
 		mapState,
@@ -160,7 +159,7 @@
 				contentModalText: '确认通过审核?', //操作文字提示语句
 				modal: false,
 				modal1: false,
-				isShareType:false
+				isShareType:false,
 				
 			}
 		},
@@ -186,12 +185,9 @@
 			if(option.type == 'share'){ this.isShareType = true }
 			this.receiptId = this.params.id = option.id
 			this.getOrderReceiptDetail(this.receiptId)
-		},
-		filters: {
-			
 		},
 		computed: {
-			...mapState(['hasLogin'])
+			...mapState(['examineBtnVisible'])
 		},
 		methods: {
 			getOrderReceiptDetail(id){

+ 13 - 42
pages/relation/ordinary/index.vue

@@ -217,7 +217,8 @@ import receiptDetails from '@/components/cm-module/receipt/receipt-details'
 import receiptRefund from '@/components/cm-module/receipt/receipt-refund'
 import receiptOrderDetails from '@/components/cm-module/receipt/receipt-orderDetails'
 import empty from '@/components/empty'
-import wxLogin from '@/services/wxLogin.js'
+import { listOrderTabs , listOrderStateTabs } from '@/utils/config.tabs.js'
+
 import { mapState, mapMutations } from 'vuex'
 const defaultListQuery = {
 	id: 0, //收款Id
@@ -248,34 +249,8 @@ export default {
 			CustomBar: this.CustomBar, // 顶部导航栏高度
 			isIphoneX: this.$store.state.isIphoneX,
 			receiptInfo: {},
-			listTabs: [
-				{
-					name: '商品订单',
-					type: 1
-				},
-				{
-					name: '订金订单',
-					type: 2
-				},
-				{
-					name: '小程序订单',
-					type: 3
-				}
-				// 	{
-				// 		name: '退款子订单',
-				// 		type: 4
-				// 	}
-			],
-			listReturnType: [
-				{
-					name: '待确认',
-					type: 2
-				},
-				{
-					name: '已确认',
-					type: 3
-				}
-			],
+			listTabs: listOrderTabs,
+			listReturnType: listOrderStateTabs,
 			listQuery: Object.assign({}, defaultListQuery),
 			refundListQuery: Object.assign({}, defaultRefundListQuery),
 			currents: 0,
@@ -574,20 +549,20 @@ export default {
 			console.log('totalOrder', this.totalOrder)
 			//处理收款状态的几种类型
 			if (
-				this.receiptInfo.receiptAmount == this.totalOrder.payableAmount ||
-				this.totalOrder.payableAmount - this.receiptInfo.receiptAmount > 10
+				this.receiptInfo.receiptAmount == this.totalOrder.surplusAmount ||
+				this.totalOrder.surplusAmount - this.receiptInfo.receiptAmount >= 10
 			) {
 				//收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10
 				this.modelTpye = 1
-				console.log('收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10', this.modelTpye)
-			} else if (this.receiptInfo.receiptAmount > this.totalOrder.payableAmount) {
-				//收款金额大于订单应收金额(可退款到余额)
+				console.log('收款金额等于订单剩余应收金额 或者是 收款金额减去订单剩余应收金额大于等于10', this.modelTpye)
+			} else if (this.receiptInfo.receiptAmount > this.totalOrder.surplusAmount) {
+				//收款金额大于订单神域应收金额(可退款到余额)
 				this.modelTpye = 2
 				console.log('收款金额大于订单应收金额(可退款到余额)', this.modelTpye)
-			} else if (this.totalOrder.payableAmount - this.receiptInfo.receiptAmount <= 10) {
-				//订单应收总金额减去收款金额小于等于10元时,才能抹平确认
+			} else if (this.totalOrder.surplusAmount - this.receiptInfo.receiptAmount <= 10) {
+				//订单剩余应收总金额减去收款金额小于等于10元时,才能抹平确认
 				this.modelTpye = 3
-				console.log('订单应收总金额减去收款金额小于等于10元时,才能抹平确认)', this.modelTpye)
+				console.log('订单剩余应收总金额减去收款金额小于等于10元时,才能抹平确认)', this.modelTpye)
 			}
 			this.modal1 = true
 		},
@@ -602,21 +577,18 @@ export default {
 		handleClick1(data) {
 			switch (data) {
 				case 1: // 小额抹平确认
-					console.log('小额抹平确认')
 					this.confirmParams.confirmType = data
 					this.confirmParams.orderIds = this.checkedIds.join(',')
 					this.orderReceiptConfirm()
 					this.modal1 = false
 					break
 				case 3: // 大额退款余额
-					console.log('大额退款余额')
 					this.confirmParams.confirmType = data
 					this.confirmParams.orderIds = this.checkedIds.join(',')
 					this.orderReceiptConfirm()
 					this.modal1 = false
 					break
 				case 4: // 确认关联
-					console.log('确认关联')
 					this.confirmParams.confirmType = data
 					this.confirmParams.orderIds = this.checkedIds.join(',')
 					this.orderReceiptConfirm()
@@ -656,7 +628,6 @@ export default {
 			} else {
 				this.checkedOrderList.splice(this.checkedOrderList.indexOf(order), 1)
 			}
-			console.log('checkedOrderList',this.checkedOrderList)
 		},
 		checkedRefundOrder(order, index) {
 			// 勾选退款子订单
@@ -670,7 +641,6 @@ export default {
 					el.isChecked = false
 				}
 			})
-			console.log('shopOrderId', this.confirmRefundParams.shopOrderId)
 		},
 		hideMobel(type) {
 			switch (type) {
@@ -1152,6 +1122,7 @@ page {
 	background-color: #ffffff;
 	padding: 0 50rpx;
 	padding-top: 20rpx;
+	z-index: 1000;
 	.button {
 		width: 100%;
 		height: 80rpx;

+ 0 - 1
pages/relation/refund/detail.vue

@@ -121,7 +121,6 @@
 	</view>
 </template>
 <script>
-	import wxLogin from '@/services/wxLogin.js'
 	import {
 		mapState,
 		mapMutations

+ 0 - 1
pages/relation/refund/index.vue

@@ -184,7 +184,6 @@
 import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
 import modalLayer from '@/components/modal-layer'
 import empty from '@/components/empty'
-import wxLogin from '@/services/wxLogin.js'
 import { mapState, mapMutations } from 'vuex'
 const defaultListQuery = {
 	pageNum: 1, //页数

+ 0 - 1
pages/relation/return/detail.vue

@@ -117,7 +117,6 @@
 	</view>
 </template>
 <script>
-	import wxLogin from '@/services/wxLogin.js'
 	import {
 		mapState,
 		mapMutations

+ 0 - 1
pages/relation/return/index.vue

@@ -194,7 +194,6 @@
 import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
 import modalLayer from '@/components/modal-layer'
 import empty from '@/components/empty'
-import wxLogin from '@/services/wxLogin.js'
 import { mapState, mapMutations } from 'vuex'
 const defaultListQuery = {
 	pageNum: 1, //页数

+ 0 - 1
pages/relation/return/list.vue

@@ -143,7 +143,6 @@
 </template>
 <script>
 import empty from '@/components/empty'
-import wxLogin from '@/services/wxLogin.js'
 import { mapState, mapMutations } from 'vuex'
 const defaultListQuery = {
 	pageNum: 1, //页数

+ 0 - 1
pages/tabBar/order/index.vue

@@ -122,7 +122,6 @@
 	import orderButton from '@/components/cm-module/orderDetails/list-button'		 //按钮
 	import modalLayer from '@/components/modal-layer'
 	import empty from '@/components/empty'
-	import wxLogin from '@/services/wxLogin.js'
 	import { mapState,mapMutations } from 'vuex'
 	function getDate(type) {
 		const date = new Date()

+ 0 - 1
pages/tabBar/product/index.vue

@@ -113,7 +113,6 @@
 	import orderButton from '@/components/cm-module/orderDetails/list-button'		 //按钮
 	import modalLayer from '@/components/modal-layer'
 	import empty from '@/components/empty'
-	import wxLogin from '@/services/wxLogin.js'
 	import { mapState,mapMutations } from 'vuex'
 	const defaultListQuery = {
 			keyword: '',

+ 0 - 1
pages/tabBar/user/mine.vue

@@ -55,7 +55,6 @@
 	</view>
 </template>
 <script>
-	import wxLogin from '@/services/wxLogin.js'
 	import { mapState,mapMutations } from 'vuex'
 	
 	export default{

+ 21 - 44
store/index.js

@@ -4,23 +4,39 @@ import api from '../common/config/caimeiApi.js'
 import authorize from '../common/config/authorize.js'
 
 Vue.use(Vuex)
+const handlebVisible = function(arr,val){
+    return arr.some(item => item === val)
+}
 const store = new Vuex.Store({
     state: {
         isWxAuthorize: false,
         hasLogin: false,
         userInfo: {},
         USER_TYPE:4,
-        wechatUserInfo: {},
         isIphoneX: false,
-        isActivity: false,
-        isLoginType: 0,
-        isLoginProductId: 0
+        handlebBtnVisible:false, // 收款列表操作按钮显示控制
+        returnBtnVisible:false,  // 收款列表口头返佣按钮显示控制
+        examineBtnVisible:false, // 审核详情审核操作按钮显示控制
     },
     mutations: {
-        login(state, provider) { //用户身份 1协销人员,2客服,3财务,4超级管理员
+        login(state, provider) { 
+            //用户身份 1协销人员,2客服,3财务,4超级管理员
+            //用户权限列表: permissions 1收款列表访问,2收款详情分享,3收款录入,4收款关联订单,5收款关联返佣,6收款关联供应商退款,7收款审核
             state.hasLogin = true
             state.userInfo = provider
             state.USER_TYPE = provider.userType
+            if(handlebVisible(provider.permissions,2)){
+                state.handlebBtnVisible = true
+                console.log('handlebBtnVisible',state.handlebBtnVisible)
+            }
+            if(handlebVisible(provider.permissions,5)){
+                state.returnBtnVisible = true
+                console.log('returnBtnVisible',state.returnBtnVisible)
+            }
+            if(handlebVisible(provider.permissions,7)){
+                state.examineBtnVisible = true
+                console.log('examineBtnVisible',state.examineBtnVisible)
+            }
             uni.setStorage({ //缓存用户登陆状态
                 key: 'userInfo',
                 data: provider
@@ -36,21 +52,11 @@ const store = new Vuex.Store({
                 key: 'token'
             })
         },
-        wxLogin(state, provider) {
-            state.isWxAuthorize = true
-            state.wechatUserInfo = provider
-            uni.setStorage({ //缓存用户登陆状态 
-                key: 'wechatUserInfo',
-                data: provider
-            })
-            uni.setStorageSync('_WX_State', 1)
-        },
         updateStatus(state, provider) {
             let TIME = api.formatDate()
             console.log(`${TIME}`, provider)
             state.userInfo = provider
             state.openid = provider.openid
-            console.log('用户微信openid', state.openid)
             uni.setStorage({ //缓存用户openid
 			    key: 'openid',
 			    data: provider.openid
@@ -60,40 +66,11 @@ const store = new Vuex.Store({
                 data: provider
             })
         },
-        updateAllNum(state, num) {
-            if (num >= 100) {
-                uni.setTabBarBadge({
-                    index: 2,
-                    text: '99+'
-                })
-            } else if (num > 0) {
-                uni.setTabBarBadge({
-                    index: 2,
-                    text: String(num)
-                })
-            } else {
-                uni.removeTabBarBadge({
-                    index: 2,
-                })
-            }
-        },
         setChangeVar(state, variable) {
             state.isIphoneX = variable
         },
         setIsIphone(state, variable) { // 记录设备信息是否为IphoneX
             state.isIphone = variable
-        },
-        setLoginType(state, variable) { // 记录登录跳转类型
-            state.isLoginType = variable
-            console.log(state.isLoginType)
-        },
-        setLoginProductId(state, variable) { // 记录跳转商品ID
-            state.isLoginProductId = variable
-            console.log(state.isLoginProductId)
-        },
-        setLoginOrderId(state, variable) { // 记录跳转订单ID
-            state.isLoginOrderId = variable
-            console.log(state.isLoginOrderId)
         }
     },
     actions: {

+ 43 - 0
utils/config.tabs.js

@@ -0,0 +1,43 @@
+//全部权限 收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
+export const defaultAllTabs = [
+    {name: '订单',type: 1},
+    {name: '非订单',type: 2},
+    {name: '返佣',type: 3},
+    {name: '供应商退款',type: 5}
+]
+
+//客服权限  收款款项类型:1订单款,2非订单款,3返佣款 4订单款或者非订单款(因财务阶段无法区分订单非订单), 5供应商退款
+export const defaultServiceTabs = [
+    {name: '订单',type: 1},
+    {name: '非订单',type: 2},
+    {name: '返佣',type: 3}
+]
+
+//订单款 收款状态:0全部 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
+export const listTabsType = [
+    {name: '全部',type: 0},
+    {name: '待确认',type: 1},
+    {name: '待审核',type: 2},
+    {name: '审核通过',type: 3}
+]
+
+//收款状态:0全部 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
+export const listReturnType = [
+    {name: '全部',type: 0},
+    {name: '待确认',type: 1},
+    {name: '已确认',type: 2}
+]
+
+//订单款项详情订单分类选项:1.商品订单 2.定金订单 3.小程序订单 4.退款子订单
+export const listOrderTabs = [
+    {name: '商品订单',type: 1},
+    {name: '订金订单',type: 2},
+    {name: '小程序订单',type: 3}
+    // {name: '退款子订单',type: 4},
+]
+
+//订单款项详情订单状态分类选项:2.待确认 3.已确认
+export const listOrderStateTabs = [
+    {name: '待确认',type: 2},
+    {name: '已确认',type: 3}
+]