Commit 0a8145d0 by huangqy

提交

parent 5e5e4279
......@@ -31,6 +31,7 @@ require('../../node_modules/mini-ali-ui/es/filter/filter-item/index?hash=7da5369
require('../../node_modules/mini-ali-ui/es/popup/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/modal/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tips/tips-dialog/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/am-checkbox/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/index/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/dashboard/dashboard?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/my/my?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
......@@ -48,3 +49,5 @@ require('../../pages/carTj/carTj?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd')
require('../../pages/changeCrop/changeCrop?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/myApply/myApply?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderFinish/orderFinish?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysOrder/sysOrder?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/editUser/editUser?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
......@@ -62,6 +62,7 @@ require('../../node_modules/mini-ali-ui/es/filter/filter-item/index?hash=7da5369
require('../../node_modules/mini-ali-ui/es/popup/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/modal/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tips/tips-dialog/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/am-checkbox/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/index/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/dashboard/dashboard?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/my/my?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
......@@ -79,6 +80,8 @@ require('../../pages/carTj/carTj?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd')
require('../../pages/changeCrop/changeCrop?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/myApply/myApply?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderFinish/orderFinish?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysOrder/sysOrder?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/editUser/editUser?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
}
self.bootstrapApp ? self.bootstrapApp({ success }) : success();
}
\ No newline at end of file
......@@ -31,6 +31,7 @@ require('../../node_modules/mini-ali-ui/es/filter/filter-item/index?hash=7da5369
require('../../node_modules/mini-ali-ui/es/popup/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/modal/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tips/tips-dialog/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/am-checkbox/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/index/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/dashboard/dashboard?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/my/my?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
......@@ -48,3 +49,5 @@ require('../../pages/carTj/carTj?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd')
require('../../pages/changeCrop/changeCrop?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/myApply/myApply?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderFinish/orderFinish?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysOrder/sysOrder?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/editUser/editUser?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
......@@ -58,6 +58,7 @@ require('../../node_modules/mini-ali-ui/es/filter/filter-item/index?hash=7da5369
require('../../node_modules/mini-ali-ui/es/popup/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/modal/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tips/tips-dialog/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/am-checkbox/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/index/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/dashboard/dashboard?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/my/my?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
......@@ -75,6 +76,8 @@ require('../../pages/carTj/carTj?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd')
require('../../pages/changeCrop/changeCrop?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/myApply/myApply?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderFinish/orderFinish?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysOrder/sysOrder?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/editUser/editUser?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
}
self.bootstrapApp ? self.bootstrapApp({ success }) : success();
}
\ No newline at end of file
import dd from 'gdt-jsapi';
var system = dd.getSystemInfoSync()
var ptf = system.platform.toUpperCase()
var aplus = require('./utils/aplus_mini.js')(
{
'metaInfo':{
'appId':ptf=='ANDROID'?'28302650':ptf=='IOS'?'28328447':'47130293',
'aplus-rhost-v':'alog.zjzwfw.gov.cn',
'aplus-rhost-g':'alog.zjzwfw.gov.cn',
}
}
);
App({
aplus,
// 全局变量,获取方法getApp().globalData
globalData: {
// 域名,用于发送请求
host: 'http://192.168.3.101:15556',
service: 'http://192.168.3.90:8044',
host: 'http://122.112.148.157:7081',
service: 'http://122.112.148.157:7080',
userInfo : {}
},
onLaunch(options) {
......
......@@ -16,7 +16,9 @@
"pages/carTj/carTj",
"pages/changeCrop/changeCrop",
"pages/myApply/myApply",
"pages/orderFinish/orderFinish"
"pages/orderFinish/orderFinish",
"pages/sysOrder/sysOrder",
"pages/editUser/editUser"
],
"window": {
"defaultTitle": "智能车辆钥匙管理小程序",
......
......@@ -26,6 +26,7 @@
layer="vertical"
name="reason"
onPickerTap="reasonPickerChange">任务类型</picker-item>
<input-item data-field="destination" placeholder="请输入" value="{{destination}}" layer="vertical" name="destination" clear="{{true}}" onClear="onClear">任务地点</input-item>
<picker-item data-field="start_time" placeholder="请选择" value="{{start_time}}" layer="vertical" name="start_time" onPickerTap="dateStartPicker">开始用车时间</picker-item>
<picker-item
......@@ -36,7 +37,7 @@
name="end_time"
onPickerTap="dateEndPicker">用车结束时间</picker-item>
<input-item data-field="timeNumber" value="{{timeNumber}}" layer="vertical" name="timeNumber" disabled='true'>时长</input-item>
<input-item data-field="destination" placeholder="请输入" value="{{destination}}" layer="vertical" name="destination" clear="{{true}}" onClear="onClear">任务地点</input-item>
<view class="page-submit">
<button type="primary" formType="submit" class="submit-btn">提交</button>
</view>
......
......@@ -18,6 +18,7 @@ Page({
},
onLoad() {
this.getLogList()
this.getCarList()
},
getLogList() {
let data = {
......@@ -37,6 +38,21 @@ Page({
}
})
},
getCarList() {
let data = {
pageNo: 1,
pageSize: 100,
}
http.post(getApp().globalData.service + '/api/T_Equipment/GetList', data).then(res => {
if (res.Success) {
this.setData({
car: res.result.records
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
bindObjPickerChange(e) {
this.setData({
arrIndex: e.detail.value,
......
<view>
<form onSubmit="handleSubmit" onReset="onReset">
<input-item data-field="username" value="{{username}}" layer="vertical" name="username" disabled='true'>用户账号</input-item>
<input-item data-field="realname" value="{{realname}}" layer="vertical" name="realname" disabled='true'>用户姓名</input-item>
<picker-item
data-field="deptName"
placeholder="请选择"
value="{{deptName}}"
layer="vertical"
name="deptName"
onPickerTap="deptPickerChange">用户部门</picker-item>
<list>
<block a:for="{{roleList}}">
<list-item
arrow="{{false}}"
index="{{index}}"
key="items-{{index}}"
last="{{index === (items.length - 1)}}"
>
<view style="display: flex; align-items: center;">
<am-checkbox data-id="{{item.id}}" id="{{item.id}}" value="{{item.id}}" ctrlChecked="{{item.ctrlChecked}}" onChange="onChange" />
<label for="{{item.id}}">{{item.roleName}}</label>
</view>
</list-item>
</block>
</list>
<view class="page-submit">
<button type="primary" formType="submit" class="submit-btn">提交</button>
</view>
</form>
</view>
import http from '../../src/http';
import util from '../../src/libs/util';
import dd from 'gdt-jsapi';
Page({
data: {
id: '',
deptList: [],
roleList: [],
},
onLoad(query) {
if (query.id) {
this.setData({
id: query.id,
username: query.username,
realname: query.realname,
deptName: query.deptName,
})
this.loadDept()
this.loadRole()
}
},
loadDept() {
http.get('/jeecg/sys/sysDepart/listAll').then(res => {
if(res.success) {
this.setData({
deptList: res.result
})
}
})
},
loadRole() {
http.get('/jeecg/sys/role/queryall').then(res => {
if(res.success) {
this.loadUserRole(res.result)
}
})
},
loadUserRole(roleList) {
http.get('/jeecg/sys/user/queryUserRole', {userid: this.data.id}).then(res => {
if(res.success) {
roleList.forEach(element => {
if (res.result.includes(element.id)) {
element.ctrlChecked = true;
}
})
this.setData({
roleList
})
}
})
},
deptPickerChange() {
my.showActionSheet({
title: '选择用户部门',
items: this.data.deptList.map(i => i.departName),
cancelButtonText: '取消',
success: (res) => {
this.setData({
deptName: this.data.deptList.map(i => i.departName)[res.index]
});
},
});
},
onChange(e) {
const { id } = e.currentTarget.dataset;
const { value } = e.detail;
const { roleList } = this.data;
roleList.forEach((element) => {
if (element.id === id) {
element.ctrlChecked = value;
}
});
this.setData({
roleList
});
},
handleSubmit(e) {
let formData = {}
formData = e.detail.value
formData.id = this.data.id
formData.selecteddeparts = this.data.deptList.find(i => i.departName == this.data.deptName ).id
formData.selectedroles = this.data.roleList.filter(i => i.ctrlChecked).map(j => j.id).join(',')
http.post(getApp().globalData.host + '/jeecg/sys/user/edit', formData).then(res => {
if(res.success) {
dd.redirectTo({
url: '../sysUser/sysUser'
})
} else {
util.ddToast({ type: 'fail', text: res.message })
}
})
},
});
{
"defaultTitle": "人员编辑",
"usingComponents": {
"list": "mini-ali-ui/es/list/index",
"list-item": "mini-ali-ui/es/list/list-item/index",
"input-item": "mini-ali-ui/es/input-item/index",
"picker-item": "mini-ali-ui/es/picker-item/index",
"multi-liner": "mini-ali-ui/es/multi-liner/index",
"am-checkbox": "mini-ali-ui/es/am-checkbox/index"
},
"allowsBounceVertical": "NO"
}
.grid {
display: flex;
flex-direction: row;
flex-wrap: wrap;
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.grid-item {
width: 20%;
text-align: center;
padding-top: 28%;
margin-left: 4%;
position: relative;
border-radius: 10rpx;
background-color: white;
width: 44%;
text-align: center;
padding-top: 28%;
margin-left: 4%;
position: relative;
border-radius: 10rpx;
background-color: white;
}
.grid-item-wrapper {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.grid-icon {
width: 64rpx;
height: 64rpx;
width: 64rpx;
height: 64rpx;
}
.grid-text {
......
......@@ -83,7 +83,7 @@ Page({
},
showPage(event) {
let _id = event.target.dataset.id
dd.navigateTo({
dd.redirectTo({
url: '../orderDetail/orderDetail?id=' + _id
})
},
......
......@@ -31,8 +31,8 @@
</view>
</view>
<view a:if={{orderInfo.detailsList.length > 0}}>
<title style="margin-top: 20rpx">用车信息</title>
<view style="height: 480rpx;" a:if={{orderInfo.detailsList.length > 0}}>
<title style="margin-top: 20rpx;">用车信息</title>
<view class="form-row">
<view class="form-row-label-single" a:if={{ userInfo.userId == orderInfo.applicant_userid }}>取车码:</view>
<view class="form-row-label-single" a:if={{ userInfo.userId == orderInfo.applicant_userid }}>{{ orderInfo.detailsList[0].pickUpCode }}</view>
......@@ -44,6 +44,13 @@
<view class="form-row-label-single">{{ orderInfo.detailsList[0].returnTime }}</view>
</view>
</view>
<view a:else>
<title style="margin-top: 20rpx"></title>
<view class="form-row">
</view>
</view>
<view a:if={{showSubmit}}>
<view class="page-submit">
<flex>
......@@ -52,4 +59,13 @@
</flex>
</view>
</view>
<view a:if={{showAction}}>
<view class="page-submit">
<flex>
<flex-item><button type="primary" size="mini" class="submit-approve-btn" onTap="getCar" a:if="{{orderInfo.state == 1}}">更换车辆</button></flex-item>
<flex-item><button type="primary" size="mini" class="submit-approve-btn" onTap="finishOrder" a:if="{{orderInfo.state == 1}}">结束订单</button></flex-item>
</flex>
</view>
</view>
</view>
\ No newline at end of file
......@@ -7,6 +7,7 @@ Page({
orderInfo: {},
id: '',
showSubmit: false,
showAction: false,
activeIndex: 1,
processList: [],
userInfo: {}
......@@ -16,7 +17,8 @@ Page({
this.setData({
id: query.id,
userInfo: getApp().globalData.userInfo,
showSubmit: query.showSubmit ? query.showSubmit : false
showSubmit: query.showSubmit ? query.showSubmit : false,
showAction: query.showAction ? query.showAction : false
})
this.getDetail(query.id)
}
......@@ -78,7 +80,7 @@ Page({
formData = Object.assign(formData, res.result)
http.post(getApp().globalData.service + '/api/T_Borrow/ApproveBorrow', formData).then(res => {
if (res.Success) {
dd.navigateTo({
dd.redirectTo({
url: '../orderList/orderList'
})
} else {
......@@ -96,4 +98,45 @@ Page({
equipment_id: this.data.carList[e.detail.value].carId
});
},
getCar() {
const that = this
http.post(getApp().globalData.service + '/api/T_Borrow/GetCarList', {}).then(res => {
if (res.Success) {
my.optionsSelect({
title: "请选择车辆",
optionsOne: res.result.map(i => i.carNumber +'('+ i.name + ')'),
success(reg) {
if (reg.selectedOneIndex) {
that.changeCar(res.result[reg.selectedOneIndex])
}
}
});
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
changeCar(car) {
http.post(getApp().globalData.service + '/api/T_Borrow/ChangeCar', {id: this.data.id, equipment_id: car.id}).then(res => {
if (res.Success) {
dd.redirectTo({
url: '../sysOrder/sysOrder'
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
finishOrder() {
http.post(getApp().globalData.service + '/api/T_Borrow/Finish', {id: this.data.id }).then(res => {
if (res.Success) {
dd.redirectTo({
url: '../sysOrder/sysOrder'
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
}
});
{
{
"defaultTitle": "订单详情",
"usingComponents": {
"button": "mini-ali-ui/es/button/index",
"title": "mini-ali-ui/es/title/index",
......
......@@ -82,7 +82,7 @@ Page({
},
showPage(event) {
let _id = event.target.dataset.id
dd.navigateTo({
dd.redirectTo({
url: '../orderDetail/orderDetail?id=' + _id
})
},
......
import http from '../../src/http'
import util from '../../src/libs/util';
import dd from 'gdt-jsapi';
import queue from '../../src/common/zzdmd'
Page({
data: {
......@@ -10,6 +11,10 @@ Page({
onLoad() {
this.getOrderList()
},
onShow() {
// 页面显示
queue('orderList','订单列表',"pages/orderList/orderList")
},
getOrderList() {
let data = {
pageNo: this.data.pageNo,
......@@ -38,7 +43,7 @@ Page({
},
showPage(event) {
let _id = event.target.dataset.id
dd.navigateTo({
dd.redirectTo({
url: '../orderDetail/orderDetail?id=' + _id + '&showSubmit=true'
})
},
......
.row {
display: flex;
align-items: center;
padding: 0 30rpx;
}
.row-title {
flex: 1;
padding-top: 28rpx;
padding-bottom: 28rpx;
font-size: 34rpx;
color: #000;
}
.row-extra {
flex-basis: initial;
font-size: 32rpx;
color: #888;
}
.row-arrow {
width: 32rpx;
height: 32rpx;
margin-left: 10rpx;
margin-top: 12rpx;
}
.container {
background: #eeeeee;
padding: 24rpx 0rpx 0rpx 0rpx;
height: 100%;
}
.container-item {
margin-bottom: 10rpx;
}
.item {
background: #fff;
height: 170rpx;
padding-top: 5rpx;
display: flex;
align-items: center;
justify-content: center;
}
.select {
display: flex;
height: 100rpx;
align-items: center;
justify-content: space-around;
}
.select .box {
display: flex;
align-items: center;
}
.select .box .name {
color: #999;
/* font-size: 26rpx; */
}
.select .box .active {
color: #212121;
/* font-size: 26rpx; */
}
.select .box image {
color: #999;
font-size: 35rpx;
position: relative;
top: -5rpx;
}
.filter-line {
border-bottom: 1px solid #f6f6f6;
}
.am-picker-content {
padding: 180rpx;
}
\ No newline at end of file
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 94vh;" onScrollToLower="onScrollToLower">
<tabs tabs="{{tabs}}" tabsName="activeTab" onTabClick="handleTabClick" onChange="handleTabChange" activeTab="{{activeTab}}">
<block a:for="{{tabs}}">
<tab-content key="{{index}}"
tabId="{{index}}"
activeTab="{{activeTab}}">
<page-result
type="empty"
brief ="当前并无订单"
local="{{false}}" a:if='{{logList.length === 0}}'/>
<view a:else>
<block a:for="{{logList}}">
<list-item
thumb="http://122.112.148.157:5000/updateImg/sysOrder.png"
index="{{index}}"
arrow="{{false}}"
upperSubtitle="{{item.start_time}}"
lowerSubtitle="{{item.end_time}}"
last="{{index === (logList.length - 1)}}"
onClick="onItemClick"
data-order="{{item}}">
{{item.realname}}
<tag type="success" size="sm" slot="afterTitle">{{ item.stateValue }}</tag>
<list-secondary
title="{{item.destination}}"
subtitle="{{item.reason}}"
slot="extra" />
</list-item>
</block>
</view>
</tab-content>
</block>
</tabs>
<modal
show="{{modalOpened}}"
showClose="{{false}}"
onButtonClick="onButtonClick"
buttons="{{buttons}}"
>
<view slot="header">温馨提示</view>
是否结束该订单?
</modal>
</scroll-view>
import http from '../../src/http'
import util from '../../src/libs/util';
import dd from 'gdt-jsapi';
Page({
data: {
pageNo: 1,
pageSize: 10,
showTop: false,
modalOpened: false,
buttons: [
{ text: '取消' },
{ text: '确定', extClass: 'buttonBold' },
],
select: [
{
title: '选择车辆',
open: false
},
{
title: '选择时间',
open: false
}
],
tabs: [
// {
// title: '待审批'
// },
{
title: '待派车'
},
{
title: '待取车'
},
{
title: '待归还'
},
{
title: '已完成'
},
// {
// title: '驳回'
// },
],
activeTab: 0
},
onLoad() {
this.getOrderList()
},
getOrderList() {
let data = {
pageNo: this.data.pageNo,
pageSize: this.data.pageSize,
type: 3,
state: this.data.activeTab + 2,
userid: getApp().globalData.userInfo.userId
}
http.post(getApp().globalData.service + '/api/T_Borrow/GetPageList', data).then(res => {
if (res.Success) {
this.setData({
logList: res.result.records
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
handleTabClick({ index, tabsName }) {
this.setData({
[tabsName]: index,
});
this.getOrderList()
},
handleTabChange({ index, tabsName }) {
this.setData({
[tabsName]: index
})
},
bindObjPickerChange(e) {
this.setData({
arrIndex: e.detail.value,
carNumber: this.data.carList[e.detail.value]
});
this.getOrderList()
},
onPullDownRefresh() {
// 页面被下拉
this.getOrderList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onScrollToLower(e) {
const _this = this
_this.setData({
pageSize: _this.data.pageSize + 8
})
this.getOrderList();
},
skipSelect(e) {
if (e.target.dataset.index === 0) {
this.setData({
show: true
})
}
if (e.target.dataset.index === 1) {
this.setData({
showTop: true
})
}
},
onPopupClose() {
this.setData({
showTop: false,
});
},
handleCallBack(data) {
this.setData({
carNumber: data[0].value,
show: false
})
this.getOrderList()
},
dateStartPicker() {
my.datePicker({
format: 'yyyy-MM-dd HH:mm',
title: '选择始出车时间',
success: (res) => {
this.setData({
start_time: res.date,
});
},
});
},
dateEndPicker() {
my.datePicker({
format: 'yyyy-MM-dd HH:mm',
title: '选择始结束时间',
success: (res) => {
this.setData({
end_time: res.date,
});
},
});
},
dateSearch() {
this.setData({
showTop: false
});
this.getOrderList()
},
onItemClick(e) {
let _id = e.target.dataset.order.id
dd.navigateTo({
url: '../orderDetail/orderDetail?id=' + _id + '&showAction=true'
})
},
onButtonClick(e) {
const { target: { dataset } } = e;
this.setData({
modalOpened: false,
});
if (dataset.index === 1) {
}
}
});
{
"defaultTitle": "订单管理",
"usingComponents": {
"page-result": "mini-ali-ui/es/page-result/index",
"list": "mini-ali-ui/es/list/index",
"list-item": "mini-ali-ui/es/list/list-item/index",
"list-secondary": "mini-ali-ui/es/list/list-secondary/index",
"tag": "mini-ali-ui/es/tag/index",
"filter": "mini-ali-ui/es/filter/index",
"filter-item": "mini-ali-ui/es/filter/filter-item/index",
"popup": "mini-ali-ui/es/popup/index",
"picker-item": "mini-ali-ui/es/picker-item/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index",
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"modal": "mini-ali-ui/es/modal/index"
}
}
......@@ -8,27 +8,14 @@
brief ="当前并无用户数据"
local="{{false}}" a:if='{{userList.length === 0}}'/>
<view a:for="{{userList}}" a:else>
<list-item onClick="onItemClick" data-id="{{item.id}}">
<avatar name="{{item.realname + ' (' + (item.roleCodeTxt[0] == 'jy' ? '普通用户' : item.roleCodeTxt[0] == 'ld' ? '领导' : item.roleCodeTxt[0] === 'gly' ? '系统管理员' : '白名单') + ')'}}" desc="{{item.phone}}" src="{{item.avatar}}" />
</list-item>
<list-item
thumb="http://122.112.148.157:5000/updateImg/police.png"
upperSubtitle="{{item.roleCodeTxt}}"
lowerSubtitle="{{item.departIds_dictText}}">
{{item.realname}}
<tag type="success" size="sm" slot="afterTitle">{{ item.username }}</tag>
<view slot="extra">
<button size="mini" type="primary" onTap="editUser" data-info="{{item}}">编辑</button>
</view>
</view>
<modal
show="{{modalOpened}}"
showClose="{{false}}"
onButtonClick="onButtonClick"
buttons="{{buttons}}"
>
<view slot="header">温馨提示</view>
系统管理员无法变更, 是否交接?
</modal>
<modal
show="{{qrCodeModal}}"
onModalClick="onModalClick"
onModalClose="onModalClose"
>
<view style="margin: 20px 0 10px 0;">用钉钉扫一扫,交接为系统管理员</view>
<image mode="widthFix" style="width: 100%;" src="{{qrCode}}"/>
<view slot="footer" onTap="onChangeRole">我知道了</view>
</modal>
</scroll-view>
\ No newline at end of file
import http from '../../src/http/index'
import util from '../../src/libs/util'
import dd from 'gdt-jsapi';
Page({
data: {
......@@ -22,6 +23,7 @@ Page({
userId: getApp().globalData.userInfo.userId
})
this.getUserList()
this.getRoleList()
},
handleInput(value) {
this.setData({
......@@ -47,14 +49,10 @@ Page({
qrCodeModal: false,
});
},
onChangeRole() {
dd.redirectTo({ url: '/pages/index/index' })
},
getUserList() {
let params = {
pageNo: this.data.pageNo,
pageSize: this.data.pageSize,
tenantId: getApp().globalData.tenantId,
realname: "*" + this.data.searchValue + "*"
}
http.get('/jeecg/sys/user/list', params).then(res => {
......@@ -67,6 +65,9 @@ Page({
}
})
},
getRoleList() {
},
onPullDownRefresh() {
this.setData({
pageSize: 10
......@@ -83,40 +84,10 @@ Page({
})
this.getUserList();
},
onItemClick(e) {
if (e.target.dataset.id === getApp().globalData.userInfo.userId) {
this.setData({
modalOpened: true,
});
} else {
my.showActionSheet({
title: '选择角色',
items: this.data.roleList.map(i => i.name),
cancelButtonText: '取消',
success: (res) => {
http.get('/jeecg/dingTalk/scan',{type: 3, userId: e.target.dataset.id, roleId: this.data.roleList[res.index].roleId, time: new Date().getTime()}).then(res => {
if (res.success) {
this.getUserList();
} else {
util.ddToast({ type: 'fail', text: res.message })
}
})
},
})
}
editUser(e) {
let user = e.target.targetDataset.info
dd.redirectTo({
url: '../editUser/editUser?id=' +user.id + '&username=' + user.username + '&realname=' + user.realname +'&deptName=' + user.departIds_dictText
})
},
onButtonClick(e) {
const { target: { dataset } } = e;
this.setData({
modalOpened: false,
});
if (dataset.index === 1) {
http.get('/jeecg/dingTalk/qrCode', {tenantId: getApp().globalData.tenantId, time: new Date().getTime()}).then(res => {
this.setData({
qrCodeModal: true,
qrCode: "data:image/jpg;base64," + res.result,
})
})
}
}
});
......@@ -5,6 +5,7 @@
"search-bar": "mini-ali-ui/es/search-bar/index",
"avatar": "antd-mini/es/Avatar/index",
"list-item": "mini-ali-ui/es/list/list-item/index",
"modal": "mini-ali-ui/es/modal/index"
"modal": "mini-ali-ui/es/modal/index",
"tag": "mini-ali-ui/es/tag/index"
}
}
......@@ -4,29 +4,52 @@ import dd from 'gdt-jsapi';
function login() {
getApp().globalData.userInfo = {userId: '15957116480', name: '黄麒宇', roleCodeList: ['jy', 'gly', 'cgkld'],sysDepart: {id: '813f982a4b71457a92003463120a2725', departName: '办公室'}}
if (!getApp().globalData.userInfo.sysDepart) {
dd.redirectTo({ url: '/pages/changeCrop/changeCrop' })
} else {
dd.redirectTo({ url: '/pages/my/my' })
}
// getApp().globalData.userInfo = {userId: '772477', name: '黄麒宇', roleCodeList: ['jy', 'gly', 'cgkld'],sysDepart: {id: '813f982a4b71457a92003463120a2725', departName: '办公室'}}
// if (!getApp().globalData.userInfo.sysDepart) {
// dd.redirectTo({ url: '/pages/changeCrop/changeCrop' })
// } else {
// dd.redirectTo({ url: '/pages/my/my' })
// }
// 获取免登授权码
// dd.getAuthCode({}).then(res => {
// if (res.code) {
// http.get('/jeecg/zzdApi/getUserInfo', {authCode: res.code}).then(res => {
// if(res.success){
// getApp().globalData.userInfo = res.result.userInfo
// if (!res.result.userInfo.sysDepart) {
// dd.redirectTo({ url: '/pages/changeCrop/changeCrop' })
// } else {
// dd.redirectTo({ url: '/pages/my/my' })
// }
// } else {
// util.ddToast({ type: 'fail', text: res.message })
// }
// })
// }
// })
dd.getAuthCode({}).then(res => {
if (res.code) {
http.get('/jeecg/zzdApi/getUserInfo', {authCode: res.code}).then(res => {
if(res.success){
getApp().globalData.userInfo = res.result.userInfo
var app = getApp();
// 如采集用户信息是异步行为需要先执行这个BLOCK埋点
app.aplus.aplus_queue.push({
action: 'aplus.setMetaInfo',
arguments: ['_hold', 'BLOCK']
});
//用户id和用户昵称需要埋政钉用户真实信息,用户ID必须用accountId ,用户昵称必须用employeeName,可通过开放平台接口获取。
// _user_id为用户ID
app.aplus.aplus_queue.push({
action: "aplus.setMetaInfo",
arguments: ["_user_id", res.result.userInfo.userId]
});
// _user_nick为用户昵称
app.aplus.aplus_queue.push({
action: "aplus.setMetaInfo",
arguments: ["_user_nick", res.result.userInfo.name]
});
app.aplus.aplus_queue.push({
action: 'aplus.setMetaInfo',
arguments: ['_hold', 'START']
});
if (!res.result.userInfo.sysDepart) {
dd.redirectTo({ url: '/pages/changeCrop/changeCrop' })
} else {
dd.redirectTo({ url: '/pages/my/my' })
}
} else {
util.ddToast({ type: 'fail', text: res.message })
}
})
}
})
}
export default login
......@@ -33,6 +33,11 @@ export const SHY_MENU_QUERY = [
export const SYS_MENU_QUERY = [
{
thumb: '../../src/assets/sysOrder.png',
page: '../sysOrder/sysOrder',
title: '订单管理'
},
{
thumb: '../../src/assets/user.png',
page: '../sysUser/sysUser',
title: '用户管理'
......@@ -43,11 +48,6 @@ export const SYS_MENU_QUERY = [
title: '车辆列表'
},
{
thumb: '../../src/assets/car.png',
page: '../sysCar/sysCar',
title: '订单管理'
},
{
thumb: '../../src/assets/carUseLog.png',
page: '../carUseLog/carUseLog',
title: '用车记录'
......
//接收3个参数:page_id,page_name,page_url
module.exports= function queue(metaId, metaName,metaPath) {
var app = getApp();
app.aplus.aplus_queue.push({
'action':'aplus.sendPV',
'arguments':[{
is_auto: false
}, {
sapp_id:'34411',
sapp_name:'zhkey',
// 自定义PV参数key-value键值对,以下内容必填,根据应用实际情况设置。
page_id: metaId,//'页面ID,与page 参数配合使用,保证唯一性',
page_name: metaName,//'页面中文名称'
page_url: metaPath
}]
})
//埋点end
};
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论