Commit 6a3d8a28 by 张立顺

权限控制

1 parent 0616ee55
<!--components/tabMine/TabMine.wxml-->
<!-- src引入filter.wxs, module给模块起名 -->
<!-- <wxs src="./index.wxs" module="filter" /> -->
<view>2222</view>
<view class="bg"></view>
<block>
<view class="main" style="margin-top:104rpx">
<view class="user-box">
<view class="user-avatar">
<block wx:if="{{userInfo.userAvatarUrl}}">
<image src="{{userInfo.userAvatarUrl}}" bindtap="getAvatar" />
</block>
<block wx:else>
<open-data type="userAvatarUrl" />
</block>
</view>
<view class="name_box">
<view class="item name text-hide">{{userInfo.name}}</view>
<view class="change_btn" bindtap="changeAccount">切换账号</view>
<block>
<view class="main" style="margin-top:104rpx">
<view class="user-box">
<view class="user-avatar">
<block wx:if="{{userInfo.userAvatarUrl}}">
<image src="{{userInfo.userAvatarUrl}}" bindtap="getAvatar" />
</block>
<block wx:else>
<open-data type="userAvatarUrl" />
</block>
</view>
<view class="name_box">
<view class="item name text-hide">{{userInfo.name}}</view>
<view class="change_btn" bindtap="changeAccount">切换账号</view>
</view>
<view class="user-info">
<view class="user-text">
<view class="item">
所属园区:{{userInfo.merchantName}}{{userInfo.isSuper==true?'(超管)':loginRoleLabel[userInfo.loginRole]}}
</view>
<view class="item">创建时间:{{userInfo.createdTime}}</view>
</view>
<view class="user-info">
<view class="user-text">
<view class="item">
所属园区:{{userInfo.merchantName}}{{userInfo.isSuper==true?'(超管)':loginRoleLabel[userInfo.loginRole]}}
</view>
<view class="item">创建时间:{{userInfo.createdTime}}</view>
</view>
</view>
</view>
<block >
<!-- <view class="scene_box">
</view>
</view>
<block>
<!-- <view class="scene_box">
<view class="title">场景</view>
<view class="select_item">
<view class="scene_message">
......@@ -47,8 +46,8 @@
<view class="change_btn" bindtap="changeScene">切换场景</view>
</view>
</view> -->
<view class="set_box">
<!-- <view class="set_item item_1" bindtap="showWork">
<view class="set_box">
<!-- <view class="set_item item_1" bindtap="showWork">
<view class="title">工位设置<image class="arrow_icon" src="/tabMine/images/arrow_icon.png" mode=""/></view>
<view class="set_tips" wx:if="{{workCount>0}}"><text style="font-size: 32rpx;color: #333333; font-weight: 500;">{{workCount}}</text>个</view>
<view class="set_tips" wx:else>根据门店设置工位数</view>
......@@ -57,24 +56,22 @@
<view class="title">录单设置<image class="arrow_icon" src="/tabMine/images/arrow_icon.png" mode=""/></view>
<view class="set_tips">设置录单必填项</view>
</view> -->
<view class="set_item item_3" bindtap="changeScene">
<view class="title">场景切换<image class="arrow_icon" src="/pages/tabMine/images/arrow_icon.png" mode=""/></view>
<view class="set_tips">{{selectedSceneName}}</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_3.png" mode=""/>
<view class="set_item item_3" bindtap="changeScene">
<view class="title">场景切换
<image class="arrow_icon" src="/pages/tabMine/images/arrow_icon.png" mode="" />
</view>
<view class="set_item item_4" bindtap="goVersionPage">
<view class="title">更新日志<image class="arrow_icon" src="/pages/tabMine/images/arrow_icon.png" mode=""/></view>
<view class="set_tips">最新{{versionData.version}}版</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_1.png" mode=""/>
<view class="set_tips">{{selectedSceneName}}</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_3.png" mode="" />
</view>
<view class="set_item item_4" bindtap="goVersionPage">
<view class="title">更新日志
<image class="arrow_icon" src="/pages/tabMine/images/arrow_icon.png" mode="" />
</view>
<view class="set_tips">最新{{versionData.version}}版</view>
<image class="icon_image" src="{{IMG_URL}}mine_icon_1.png" mode="" />
</view>
</block>
<view class="logout text-center" bindtap="logout">退出账号</view>
</view>
</block>
</view>
</block>
<view class="logout text-center" bindtap="logout">退出账号</view>
</view>
</block>
\ No newline at end of file
......@@ -18,7 +18,7 @@ export const appId = 'wx570d9331f9ace0bd'
* 4预发布
* 5cdptest
*/
let index = 1
let index = 2
const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
......@@ -66,4 +66,4 @@ export const quotedImgUrl = createQuotedUrl[target[envIndex]]
export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'
// 图片基地址
export const ImgUrl = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
export const ImgUrl = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
\ No newline at end of file
......@@ -65,13 +65,20 @@ Component({
value: 'avgQuotationPrice',
icon: 'icon_11',
unit: true
}, {
label: '报价单量',
value: 'totalOrderCount',
icon: 'icon_4'
}, {
label: '成交单量',
value: 'totalSuccessOrderCount',
icon: 'icon_7'
}],
menuList: [{
menuText: '新建工单',
icon: 'create_order',
path: ''
}
],
}],
loginRoleLabel: {
1: '超管',
2: '商户管理员',
......@@ -85,7 +92,7 @@ Component({
lifetimes: {
attached() {
this.onLoad()
}
......@@ -95,7 +102,7 @@ Component({
* 组件的方法列表
*/
methods: {
onLoad (){
onLoad() {
this.setData({
storeInfo: wx.$util.getUserInfo()?.default4SStoreInfo || {},
userInfo: wx.$util.getUserInfo() || {}
......@@ -115,19 +122,17 @@ Component({
code,
message
} = res
let data = res.data ?
{
...res.data,
todayTurnover: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
todayTurDecimal: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[1] : '00',
// totalTurnover: res.data.totalTurnover ? (Math.round()(res.data.totalTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
totalTurnover: res.data.totalTurnover ? Math.round(res.data.totalTurnover / 100):'0',
totalTurDecimal: res.data.totalTurnover ? ((res.data.totalTurnover / 100).toFixed(2) + '').split('.')[1] : '00',
monthTurnover: res.data.monthTurnover ? ((res.data.monthTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
// monthTurnover: 12233,
// monthTurDecimal: res.data.monthTurnover ? ((res.data.monthTurnover / 100).toFixed(2) + '').split('.')[1] : '00'
} :
{}
let data = res.data ? {
...res.data,
todayTurnover: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
todayTurDecimal: res.data.todayTurnover ? ((res.data.todayTurnover / 100).toFixed(2) + '').split('.')[1] : '00',
// totalTurnover: res.data.totalTurnover ? (Math.round()(res.data.totalTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
totalTurnover: res.data.totalTurnover ? Math.round(res.data.totalTurnover / 100) : '0',
totalTurDecimal: res.data.totalTurnover ? ((res.data.totalTurnover / 100).toFixed(2) + '').split('.')[1] : '00',
monthTurnover: res.data.monthTurnover ? ((res.data.monthTurnover / 100).toFixed(2) + '').split('.')[0] : '0',
// monthTurnover: 12233,
// monthTurDecimal: res.data.monthTurnover ? ((res.data.monthTurnover / 100).toFixed(2) + '').split('.')[1] : '00'
} : {}
if (code == '0') {
this.setData({
statisticsObj: data
......@@ -141,32 +146,39 @@ Component({
getData() {
// const userInfo = wx.$util.getUserInfo()
const { dataActive,merchantId } = this.data
const {
dataActive,
merchantId
} = this.data
let today = new Date()
let thisMonth = new Date(new Date().setDate(1)).format('yyyy-MM-dd')
const dataobj = {
today:{
startTime:today.format('yyyy-MM-dd') + ' 00:00:00',
today: {
startTime: today.format('yyyy-MM-dd') + ' 00:00:00',
endTime: today.format('yyyy-MM-dd') + ' 23:59:59',
},
month:{
startTime:thisMonth + ' 00:00:00',
month: {
startTime: thisMonth + ' 00:00:00',
endTime: today.format('yyyy-MM-dd') + ' 23:59:59',
},
total:{
startTime:'',
total: {
startTime: '',
endTime: '',
}
}
outputValueStatistics({
...dataobj[dataActive],
}).then(res => {
let { code, data, message } = res
let {
code,
data,
message
} = res
if (code == 0) {
data.conversionRate = NP.times(data.conversionRate,100)
data.avgPrice = NP.divide(data.avgPrice,100)
data.avgPrice = NP.round(data.avgPrice, 0 )
data.totalOutputValue = NP.round(data.totalOutputValue, 0 )
data.conversionRate = NP.times(data.conversionRate, 100)
data.avgPrice = NP.divide(data.avgPrice, 100)
data.avgPrice = NP.round(data.avgPrice, 0)
data.totalOutputValue = NP.round(data.totalOutputValue, 0)
this.setData({
staticData: data || {}
})
......@@ -175,8 +187,10 @@ Component({
}
})
},
changeDataSelect (e) {
let { name } = e.currentTarget.dataset
changeDataSelect(e) {
let {
name
} = e.currentTarget.dataset
this.setData({
dataActive: name
})
......@@ -200,7 +214,9 @@ Component({
// }
// },
navGo() {
let { mode } = this.data
let {
mode
} = this.data
wx.$router.go(mode ? 'createOrderCarQuotationSimple' : 'createOrderCarQuotation')
// console.log(e)
// const thisPage = wx.$router.getPageInstance()
......@@ -209,4 +225,4 @@ Component({
// if (!item.path) wx.$util.showToast('模块暂未开通\r\n敬请期待')
},
}
})
})
\ No newline at end of file
// tabMine/pages/completeBuild/completeBuild.js
import api from '../../api.js'
import {
ImgUrl
ImgUrl
} from '~/config';
Page({
/**
* 页面的初始数据
*/
data: {
IMG_URL: ImgUrl,
isYqdSuper: '',
tipsProps: {
tipsText: '小程序下单后,驻店员工需让客户在订单中签名确认订单,才可完结为最终施工单',
showTips: true,
type: 1
},
/**
* 页面的初始数据
*/
data: {
IMG_URL: ImgUrl,
isYqdSuper: '',
tipsProps: {
tipsText: '小程序下单后,驻店员工需让客户在订单中签名确认订单,才可完结为最终施工单',
showTips: true,
type: 1
},
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getMerchantConfiguration()
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getMerchantConfiguration()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {},
// 获取商户配置
getMerchantConfiguration() {
let {
saturdayFlag
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
api.getMerchantConfiguration({
merchantId,
sceneType: '1'
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
if (data) {
saturdayFlag = data.signatureSwitch ? true : false
}
} else {
this.showToast(message)
}
this.setData({
saturdayFlag
})
})
},
// 获取商户配置
getMerchantConfiguration() {
let {
saturdayFlag
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
api.getMerchantConfiguration({
merchantId,
sceneType: '1'
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
if (data) {
saturdayFlag = data.signatureSwitch ? true : false
}
} else {
this.showToast(message)
}
this.setData({
saturdayFlag
})
})
},
//是否开启电子签名
changeSwitch(e) {
console.log('e', e);
let {
value
} = e.detail
let {
target
} = e.currentTarget.dataset
this.setData({
[target]: value
})
this.updateSignatureConfiguration()
},
//是否开启电子签名
changeSwitch(e) {
let {
userInfo
} = this.data
if (userInfo.userType == 2) return
console.log('e', e);
let {
value
} = e.detail
let {
target
} = e.currentTarget.dataset
this.setData({
[target]: value
})
this.updateSignatureConfiguration()
},
// 修改配置
updateSignatureConfiguration() {
let {
saturdayFlag
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
let signatureSwitch = saturdayFlag ? 1 : 0
api.updateSignatureConfiguration({
merchantId,
sceneType: '1',
signatureSwitch
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
console.log('data', data);
} else {
this.showToast(message)
}
})
},
// 修改配置
updateSignatureConfiguration() {
let {
saturdayFlag
} = this.data
let {
merchantId
} = wx.$util.getUserInfo()
let signatureSwitch = saturdayFlag ? 1 : 0
api.updateSignatureConfiguration({
merchantId,
sceneType: '1',
signatureSwitch
}).then(res => {
let {
code,
data
} = res
if (code == '0') {
console.log('data', data);
} else {
this.showToast(message)
}
})
},
})
\ No newline at end of file
......@@ -131,3 +131,6 @@ page {
justify-content: space-between;
}
.disabled {
opacity: .5;
}
\ No newline at end of file
......@@ -3,7 +3,7 @@
<view class="main {{isFullSucreen?'isFullSucreen':'' }} {{showTips?'fullSucreen-tips':'' }}" style="height:calc(100vh - {{isFullSucreen?(34+71.5) : 71.5}}px);">
<view class="createData">
<view class="label">是否开启客户电子签名及评分选项</view>
<switch color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{saturdayFlag}}" bindchange="changeSwitch" data-target="saturdayFlag" />
<switch class=" {{userInfo.userType == 2 ?'disabled':''}}" color="#347BFF" isYqdSuper="{{isYqdSuper}}" checked="{{saturdayFlag}}" bindchange="changeSwitch" data-target="saturdayFlag" />
</view>
<view class="box">
<view class="box-label">客户电子签名及施工页面:</view>
......
......@@ -32,6 +32,7 @@ Page({
technicianList,
userInfo
} = this.data
if (userInfo.userType == 2) return
technicianList.unshift({
staffName: '',
staffPhone: '',
......@@ -45,6 +46,10 @@ Page({
},
editTechicianInfo(e) {
let {
userInfo
} = this.data
if (userInfo.userType == 2) return
let {
index
} = e.currentTarget.dataset
this.setData({
......
......@@ -145,4 +145,8 @@ page {
.placeholder-class {
color: #BEC1C7;
}
.disabled {
opacity: .5;
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
<view class="scrollCon">
<view class="merchantNameCon">
<view class="name">{{userInfo.merchantName}}</view>
<view class="addIcon" bind:tap="addTechnicalItem">
<view class="addIcon {{userInfo.userType == 2 ?'disabled':''}}" bind:tap="addTechnicalItem">
<image class="icon-plus" src="{{IMG_URL}}/miniProgram/icon-plus.png" />
技师
</view>
......@@ -24,7 +24,7 @@
</view>
<view class="phone">手机号 {{item.staffPhone}}</view>
</view>
<image class="icon-edit" bind:tap="editTechicianInfo" data-index="{{index}}" src="{{IMG_URL}}/miniProgram/grayEditIcon.png" />
<image class="icon-edit {{userInfo.userType == 2 ?'disabled':''}}" bind:tap="editTechicianInfo" data-index="{{index}}" src="{{IMG_URL}}/miniProgram/grayEditIcon.png" />
</view>
<!-- <view class="top">
<view class="message">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!