Commit 0a0b22af by huangqy

提交下

Signed-off-by: huangqy <huangqy@junmp.com.cn>
parents
# dependencies
**/node_modules
.idea
.DS_Store
# misc
npm-debug.log*
yarn-error.log
yarn.lock
package-lock.json
*bak
# visual studio code
.vscode
.history
*.log
functions/*
.temp/**
.eslintcache
const g = typeof global !== 'undefined' ? global : self;
g.appXAppJson = {
"app": {
"$homepage": "pages/index/index"
}
};
if(!self.Map || !self.Set || !self.Symbol) {
importScripts('https://gw.alipayobjects.com/as/g/appx_release/deps/1.0.3/es6-set-map-symbol.js');
}
\ No newline at end of file
require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$');
require('../../node_modules/mini-ali-ui/es/am-icon/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/search-bar/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/loading/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/auto-size-img/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/list-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/title/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/container/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../src/components/topitem/topitem?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/antd-mini/es/Avatar/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../src/components/top/top?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/button/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/page-result/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/badge/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tabs/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tabs/tab-content/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/flex/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/flex/flex-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/input-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/picker-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/multi-liner/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tag/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/card/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/list-secondary/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/filter/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/filter/filter-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
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('../../pages/index/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/dashboard/dashboard?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/my/my?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/myApply/myApply?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/applyBorrowCar/applyBorrowCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderList/orderList?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/keyList/keyList?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderDetail/orderDetail?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/carUseLog/carUseLog?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysUser/sysUser?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysCar/sysCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/addCar/addCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysSetting/sysSetting?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/carTj/carTj?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/changeCrop/changeCrop?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/myApply/myApply?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
if(!self.__appxInited) {
self.__appxInited = 1;
require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$');
if( navigator.userAgent && (navigator.userAgent.indexOf('LyraVM') > 0 || navigator.userAgent.indexOf('AlipayIDE') > 0) ) {
var AFAppX = self.AFAppX.getAppContext ? self.AFAppX.getAppContext().AFAppX : self.AFAppX;
} else {
importScripts('https://appx/af-appx.worker.min.js');
var AFAppX = self.AFAppX;
}
self.getCurrentPages = AFAppX.getCurrentPages;
self.getApp = AFAppX.getApp;
self.Page = AFAppX.Page;
self.App = AFAppX.App;
self.my = AFAppX.bridge || AFAppX.abridge;
self.abridge = self.my;
self.Component = AFAppX.WorkerComponent || function(){};
self.$global = AFAppX.$global;
self.requirePlugin = AFAppX.requirePlugin;
if(AFAppX.registerApp) {
AFAppX.registerApp({
appJSON: appXAppJson,
});
}
if(AFAppX.compilerConfig){ AFAppX.compilerConfig.component2 = true; }
function success() {
require('../../app');
require('../../node_modules/mini-ali-ui/es/am-icon/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/search-bar/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/loading/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/auto-size-img/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/list-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/title/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/container/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../src/components/topitem/topitem?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/antd-mini/es/Avatar/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../src/components/top/top?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/button/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/page-result/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/badge/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tabs/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tabs/tab-content/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/flex/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/flex/flex-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/input-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/picker-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/multi-liner/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tag/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/card/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/list-secondary/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/filter/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/filter/filter-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
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('../../pages/index/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/dashboard/dashboard?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/my/my?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/myApply/myApply?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/applyBorrowCar/applyBorrowCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderList/orderList?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/keyList/keyList?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderDetail/orderDetail?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/carUseLog/carUseLog?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysUser/sysUser?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysCar/sysCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/addCar/addCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysSetting/sysSetting?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/carTj/carTj?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/changeCrop/changeCrop?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/myApply/myApply?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
}
self.bootstrapApp ? self.bootstrapApp({ success }) : success();
}
\ No newline at end of file
const g = typeof global !== 'undefined' ? global : self;
g.appXAppJson = {
"app": {
"$homepage": "pages/index/index"
}
};
if(!self.Map || !self.Set || !self.Symbol) {
importScripts('https://gw.alipayobjects.com/as/g/appx_release/deps/1.0.3/es6-set-map-symbol.js');
}
importScripts(`https://appx/af-appx.worker.min.js`);
require('@alipay/appx-compiler/lib/sjsEnvInit');
require('./config$');
require('../../node_modules/mini-ali-ui/es/am-icon/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/search-bar/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/loading/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/auto-size-img/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/list-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/title/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/container/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../src/components/topitem/topitem?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/antd-mini/es/Avatar/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../src/components/top/top?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/input-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/picker-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/multi-liner/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/button/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/page-result/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/badge/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tabs/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tabs/tab-content/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/flex/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/flex/flex-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/tag/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/card/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/list/list-secondary/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/filter/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../node_modules/mini-ali-ui/es/filter/filter-item/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
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('../../pages/index/index?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/dashboard/dashboard?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/my/my?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/applyBorrowCar/applyBorrowCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderList/orderList?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/keyList/keyList?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/orderDetail/orderDetail?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/carUseLog/carUseLog?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysUser/sysUser?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysCar/sysCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/addCar/addCar?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/sysSetting/sysSetting?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/carTj/carTj?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
require('../../pages/changeCrop/changeCrop?hash=7da53690ff015fafc40ebbe2de99bf33c6f02acd');
.page-container {
background-color: #f5f5f5;
}
.page-submit {
position: fixed;
bottom: 10rpx;
width: 100%;
}
.submit-btn {
width: 90%;
margin: auto;
border-radius: 20rpx;
}
App({
// 全局变量,获取方法getApp().globalData
globalData: {
// 域名,用于发送请求
host: 'http://192.168.3.101:15556',
service: 'http://192.168.3.90:8044',
userInfo : {}
},
onLaunch(options) {
},
onShow(options) {
},
onHide() {
console.log('App Hide');
},
});
{
"pages": [
"pages/index/index",
"pages/dashboard/dashboard",
"pages/my/my",
"pages/myApply/myApply",
"pages/applyBorrowCar/applyBorrowCar",
"pages/orderList/orderList",
"pages/keyList/keyList",
"pages/orderDetail/orderDetail",
"pages/carUseLog/carUseLog",
"pages/sysUser/sysUser",
"pages/sysCar/sysCar",
"pages/addCar/addCar",
"pages/sysSetting/sysSetting",
"pages/carTj/carTj",
"pages/changeCrop/changeCrop",
"pages/myApply/myApply"
],
"window": {
"defaultTitle": "智能车辆钥匙管理小程序",
"titleBarColor": "#2074D4",
"allowsBounceVertical": "YES",
"pullRefresh": true
}
}
{
"component2": true
}
\ No newline at end of file
{
"dependencies": {
"antd-mini": "^0.0.8",
"dingtalk-design-libs": "^0.0.24",
"gdt-jsapi": "^1.9.39",
"mini-ali-ui": "^1.4.1"
}
}
<view>
<form onSubmit="handleSubmit" onReset="onReset">
<input-item data-field="carType" placeholder="请输入" value="{{carType}}" layer="vertical" name="carType" clear="{{true}}" onClear="onClear">汽车品牌</input-item>
<input-item data-field="carNumber" placeholder="请输入" value="{{carNumber}}" layer="vertical" name="carNumber" clear="{{true}}" onClear="onClear">汽车车牌</input-item>
<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';
Page({
data: {
id: ''
},
onLoad(query) {
if (query.id) {
this.setData({
id: query.id,
carNumber: query.carNumber,
carType: query.carType
})
}
},
onClear(e) {
this.setData({
[e.target.dataset.field]: ''
});
},
handleSubmit(e) {
let formData = {}
formData = e.detail.value
formData.id = this.data.id
formData.tenant_id = getApp().globalData.tenantId
formData.create_by = getApp().globalData.userInfo.realname
http.post(getApp().globalData.service + '/api/T_Equipment/AddOrUpdateEquipment', formData).then(res => {
if(res.Success) {
dd.redirectTo({
url: '../sysCar/sysCar'
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
});
{
"defaultTitle": "车辆操作",
"usingComponents": {
"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"
},
"allowsBounceVertical": "NO"
}
<view>
<form onSubmit="handleSubmit" onReset="onReset">
<input-item data-field="borrow_code" value="{{borrow_code}}" layer="vertical" name="borrow_code" disabled='true'>用车单号</input-item>
<input-item data-field="name" value="{{name}}" layer="vertical" name="name" disabled='true'>申请人</input-item>
<picker-item
data-field="carType"
placeholder="请选择"
value="{{carType}}"
layer="vertical"
name="carType"
onPickerTap="carTypePickerChange">车辆种类</picker-item>
<picker-item
data-field="isPolice"
placeholder="请选择"
value="{{isPolice}}"
layer="vertical"
name="isPolice"
onPickerTap="isPoliceCarPickerChange">车辆类型</picker-item>
<picker-item
data-field="reason"
placeholder="请选择"
value="{{reason}}"
layer="vertical"
name="reason"
onPickerTap="reasonPickerChange">任务类型</picker-item>
<picker-item data-field="start_time" placeholder="请选择" value="{{start_time}}" layer="vertical" name="start_time" onPickerTap="dateStartPicker">开始用车时间</picker-item>
<picker-item
data-field="end_time"
placeholder="请选择"
value="{{end_time}}"
layer="vertical"
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>
</form>
</view>
import http from '../../src/http';
import util from '../../src/libs/util';
import dd from 'gdt-jsapi';
Page({
data: {
borrow_code : '',
name: '',
destination: '',
start_time : '',
end_time : '',
reason: '',
isPoliceCar: '',
policeCar: '',
carType: '',
timeNumber: '',
carTypeList: ['5座', '7座', '中型面包车'],
isPoliceCarList: ['警车', '非警车'],
reasons: ['区内执法执勤', '市内出差', '市外出差', '省外出差'],
url: {
getProcess: '/api/Sys_Process/GetProcess',
save: '/api/T_Borrow/SaveOrUpdate'
}
},
onLoad() {
this.getBorrowCode()
},
getBorrowCode(){
http.get('/jeecg/sys/fillRule/testFillRule', {ruleCode: 'shop_order_num'}).then(res => {
if (res.success) {
this.setData({
borrow_code : res.result,
name : getApp().globalData.userInfo.name,
});
} else {
util.ddToast({ type: 'fail', text: res.msg })
}
})
},
onClear(e) {
this.setData({
[e.target.dataset.field]: ''
});
},
dateStartPicker() {
const _this = this
my.datePicker({
format: 'yyyy-MM-dd HH:mm',
success: (res) => {
this.setData({
start_time: res.date,
timeNumber: (_this.data.end_time && res.date) ? _this.getIntervalHour(res.date, _this.data.end_time) : 0
})
}
})
},
dateEndPicker() {
const _this = this
my.datePicker({
format: 'yyyy-MM-dd HH:mm',
success: (res) => {
this.setData({
end_time: res.date,
timeNumber: (_this.data.start_time && res.date) ? _this.getIntervalHour(_this.data.start_time, res.date) : 0
})
}
})
},
getIntervalHour(dt1,dt2) {
if(typeof(dt1)=="string") {
dt1=new Date(dt1.replace(/-/,'/'));
dt2=new Date(dt2.replace(/-/,'/'));
}
var res = dt2-dt1;
if(isNaN(res))
throw Error("invalid dates arguments");
return Math.trunc(res/(1000*60*60));
},
carTypePickerChange() {
my.showActionSheet({
title: '选择车辆种类',
items: this.data.carTypeList,
cancelButtonText: '取消',
success: (res) => {
this.setData({
carType: this.data.carTypeList[res.index]
});
},
});
},
isPoliceCarPickerChange() {
my.showActionSheet({
title: '选择车辆类型',
items: this.data.isPoliceCarList,
cancelButtonText: '取消',
success: (res) => {
this.setData({
isPolice: this.data.isPoliceCarList[res.index],
isPoliceCar: res.index
});
},
});
},
reasonPickerChange() {
my.showActionSheet({
title: '选择工作内容',
items: this.data.reasons,
cancelButtonText: '取消',
success: (res) => {
this.setData({
reason: this.data.reasons[res.index]
});
},
});
},
onBzInput(e) {
this.setData({
bz: e.detail.value
});
},
handleSubmit(e) {
let formData = {}
formData = e.detail.value
formData.userid = getApp().globalData.userInfo.userId
formData.carType = this.data.carType
formData.isPoliceCar = this.data.isPoliceCar
formData.reason = this.data.reason
formData.start_time = this.data.start_time
formData.end_time = this.data.end_time
if (!formData.carType) {
return util.ddToast({ type: 'fail', text: '请选择车辆种类' })
}
if (!this.data.isPolice) {
return util.ddToast({ type: 'fail', text: '请选择车辆类型' })
}
if (!formData.reason) {
return util.ddToast({ type: 'fail', text: '请选择任务类型' })
}
if (!formData.destination) {
return util.ddToast({ type: 'fail', text: '请输入任务地点' })
}
if (!formData.start_time) {
return util.ddToast({ type: 'fail', text: '请选择开始时间' })
}
if (!formData.end_time) {
return util.ddToast({ type: 'fail', text: '请选择结束时间' })
}
if (formData.timeNumber < 0) {
return util.ddToast({ type: 'fail', text: '时长不能为负数' })
}
let code = ''
if (formData.timeNumber < 24 && (formData.reason == '区内执法执勤' || formData.reason == '市内出差')) {
code = 'bmldsh'
}
else if (formData.reason == '省外出差' || formData.timeNumber > 120) {
code = 'zwsh'
} else {
code = 'jbksh'
}
const _this = this
http.post(getApp().globalData.service + this.data.url.getProcess, {code: code, stepId: "",flowGateway: ""}).then(res => {
if(res.Success) {
formData = Object.assign(formData, res.result)
http.post(getApp().globalData.service + _this.data.url.save, formData).then(res => {
if (res.Success) {
dd.redirectTo({
url: '../orderList/orderList'
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
});
{
"defaultTitle": "用车申请",
"usingComponents": {
"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"
},
"allowsBounceVertical": "NO"
}
.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">
<popup show="{{showTop}}" position="top" zIndex="{{999}}" mask="{{true}}" onClose="onPopupClose">
<view>
<picker-item
data-field="start_time"
value="{{start_time}}"
name="start_time"
onPickerTap="dateStartPicker">开始时间</picker-item>
<picker-item
data-field="end_time"
value="{{end_time}}"
name="end_time"
onPickerTap="dateEndPicker">结束时间</picker-item>
<button size="default" type="primary" onTap="dateSearch">确定</button>
</view>
</popup>
<view class="select">
<view class="box" a:for="{{select}}" a:key="{{index}}" data-index="{{index}}" onTap="skipSelect">
<view class="name">{{item.title}}</view>
<image class="row-arrow" src="http://122.112.148.157:5000/updateImg/箭头下.png" mode="aspectFill"></image>
</view>
</view>
<view class="filter-line" />
<page-result
type="empty"
brief ="当前并无用车统计数据"
local="{{false}}" a:if='{{tjList.length === 0}}'/>
<view a:else>
<block a:for="{{tjList}}">
<list-item
index="{{index}}"
arrow="{{false}}"
last="{{index === (tjList.length - 1)}}">
{{item.realname}}
<list-secondary
title="{{item.sumCount}}次"
slot="extra" />
</list-item>
</block>
</view>
</scroll-view>
import http from '../../src/http'
import util from '../../src/libs/util';
Page({
data: {
pageNo: 1,
pageSize: 10,
carNumber: '',
carList: [],
showTop: false,
select: [
{
title: '选择时间',
open: false
}
]
},
onLoad() {
this.getTjList()
},
getTjList() {
let data = {
tenant_id: getApp().globalData.tenantId,
start_time: this.data.start_time,
end_time: this.data.end_time,
}
http.post(getApp().globalData.service + '/api/T_Tj/RenTj', data).then(res => {
if (res.Success) {
this.setData({
tjList:res.result
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
bindObjPickerChange(e) {
this.setData({
arrIndex: e.detail.value,
carNumber: this.data.carList[e.detail.value]
});
this.getTjList()
},
onPullDownRefresh() {
// 页面被下拉
this.getTjList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onScrollToLower(e) {
const _this = this
_this.setData({
pageSize: _this.data.pageSize + 8
})
this.getTjList();
},
skipSelect(e) {
if (e.target.dataset.index === 0) {
this.setData({
showTop: true
})
}
},
onPopupClose() {
this.setData({
showTop: false,
});
},
handleCallBack(data) {
this.setData({
carNumber: data[0].value,
show: false
})
this.getTjList()
},
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.getTjList()
}
});
{
"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"
}
}
.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">
<filter show="{{show}}" max="{{1}}" equalRows="{{3}}">
<block a:for="{{car}}">
<filter-item value="{{item.carNumber}}" id="{{item.id}}" onChange="handleCallBack" selected="{{item.selected}}" key="filter-item-{{key}}" />
</block>
</filter>
<popup show="{{showTop}}" position="top" zIndex="{{999}}" mask="{{true}}" onClose="onPopupClose">
<view>
<picker-item
data-field="start_time"
value="{{start_time}}"
name="start_time"
onPickerTap="dateStartPicker">开始时间</picker-item>
<picker-item
data-field="end_time"
value="{{end_time}}"
name="end_time"
onPickerTap="dateEndPicker">结束时间</picker-item>
<button size="default" type="primary" onTap="dateSearch">确定</button>
</view>
</popup>
<view class="select">
<view class="box" a:for="{{select}}" a:key="{{index}}" data-index="{{index}}" onTap="skipSelect">
<view class="name">{{item.title}}</view>
<image class="row-arrow" src="http://122.112.148.157:5000/updateImg/箭头下.png" mode="aspectFill"></image>
</view>
</view>
<view class="filter-line" />
<page-result
type="empty"
brief ="当前并无用车数据"
local="{{false}}" a:if='{{logList.length === 0}}'/>
<view a:else>
<block a:for="{{logList}}">
<list-item
index="{{index}}"
arrow="{{false}}"
upperSubtitle="{{item.upTime}}"
last="{{index === (logList.length - 1)}}">
{{item.realname}}
<tag a:if="{{item.type === 0 }}" type="warning" size="sm" slot="afterTitle">取车</tag>
<tag a:if="{{item.type === 1 }}" type="success" size="sm" slot="afterTitle">还车</tag>
<list-secondary
title="{{item.carNumber}}"
subtitle="{{item.carType}}"
slot="extra" />
</list-item>
</block>
</view>
</scroll-view>
import http from '../../src/http'
import util from '../../src/libs/util';
Page({
data: {
pageNo: 1,
pageSize: 10,
carNumber: '',
carList: [],
showTop: false,
select: [
{
title: '选择车辆',
open: false
},
{
title: '选择时间',
open: false
}
]
},
onLoad() {
this.getLogList()
this.getCarList()
},
getCarList() {
http.post(getApp().globalData.service + '/api/T_Equipment/EquipmentPageList', {pageSize: 20, tenant_id: getApp().globalData.tenantId}).then(res => {
if (res.Success) {
this.setData({
car: res.result.records,
carList: res.result.records.map(i => i.carNumber)
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
getLogList() {
let data = {
tenant_id: getApp().globalData.tenantId,
pageNo: this.data.pageNo,
pageSize: this.data.pageSize,
userid: getApp().globalData.userInfo.roleCodeList.find(i => i === 'ld') ? '' : getApp().globalData.userInfo.userId,
carNumber: this.data.carNumber,
start_time: this.data.start_time,
end_time: this.data.end_time,
}
http.post(getApp().globalData.service + '/api/T_Equipment/HistoryEquPageList', data).then(res => {
if (res.Success) {
this.setData({
logList:res.result.records
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
bindObjPickerChange(e) {
this.setData({
arrIndex: e.detail.value,
carNumber: this.data.carList[e.detail.value]
});
this.getLogList()
},
onPullDownRefresh() {
// 页面被下拉
this.getLogList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onScrollToLower(e) {
const _this = this
_this.setData({
pageSize: _this.data.pageSize + 8
})
this.getLogList();
},
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.getLogList()
},
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.getLogList()
}
});
{
"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"
}
}
.page-center {
position:absolute;
left: 18%;
top: 18%;
}
/* .my-picker {
background: #EFEFF4;
} */
.submit-btn {
margin-top: 50rpx;
}
\ No newline at end of file
<view>
<view class="page-center">
<search-bar value="{{searchValue}}" focus="{{true}}" maxLength="{{20}}" showVoice="{{false}}" placeholder="搜索" onInput="handleInput"
onSubmit="searchSubmit"
onClear="handleClear"
showCancelButton="{{false}}" />
<picker-view value="{{value}}" onChange="onChange" class="my-picker">
<picker-view-column>
<block a:for="{{departList}}">
<view key="{{index}}">{{item.departName}}</view>
</block>
</picker-view-column>
</picker-view>
<button type="primary" class="submit-btn" onTap="handleSubmit">加入部门</button>
</view>
</view>
import http from '../../src/http';
import login from '../../src/api/login';
import util, {fuzzyQuery} from '../../src/libs/util.js';
Page({
data: {
url: {
getDepart: '/jeecg/sys/sysDepart/listAll',
bindTenant: '/jeecg/zzdApi/bindSysDepart'
},
departList: [],
value: [0],
searchValue: '',
},
onLoad(query) {
// 页面加载
this.initDepart()
},
initDepart() {
const _this = this
http.get(this.data.url.getDepart).then(res => {
if (res.success) {
_this.setData({
departList: res.result
})
} else {
util.ddToast({ type: 'fail', text: res.message })
}
})
},
searchSubmit() {
let departName = fuzzyQuery(this.data.departList.map(i => i.departName), this.data.searchValue)[0]
let index = this.data.departList.findIndex(i => i.departName === departName)
this.setData({
value: [index]
})
},
handleInput(value) {
this.setData({
searchValue: value,
});
},
handleClear() {
this.setData({
searchValue: '',
});
},
onChange(e) {
this.setData({
value: e.detail.value
});
},
handleSubmit() {
const depart = this.data.departList[this.data.value[0]]
http.post(getApp().globalData.host + this.data.url.bindTenant, { username: getApp().globalData.userInfo.userId, departIds: depart.id}).then(res => {
if (res.success) {
login()
} else {
util.ddToast({ type: 'fail', text: res.message })
}
})
},
});
{
"usingComponents": {
"search-bar": "mini-ali-ui/es/search-bar/index"
},
"allowsBounceVertical": "NO"
}
\ No newline at end of file
.myList {
margin-top: 1px;
}
\ No newline at end of file
<view>
工作台
</view>
\ No newline at end of file
Page({
data: {
},
onLoad() {},
});
{
"usingComponents": {}
}
.page-center {
position:absolute;
left: 18%;
top: 18%;
}
/* .my-picker {
background: #EFEFF4;
} */
.submit-btn {
margin-top: 50rpx;
}
.row{
height: 60rpx;
line-height: 60rpx;
}
<view>
</view>
\ No newline at end of file
import login from '../../src/api/login';
import {
openAuthMiniApp,
disposeAuthData,
offAuthListener
} from "dingtalk-design-libs/biz/openAuthMiniApp";
import dd from 'gdt-jsapi';
Page({
data: {
url: {
getTenantList: '/api/Sys_Tenant/GetTenantList'
},
tenantList: [],
value: [0],
searchValue: '',
showLogo: true,
corpId: '',
},
onLoad() {
login()
},
openApp() {
return openAuthMiniApp({
path: "pages/home/home", // 不要改
panelHeight: "percent50",
extraData: {
clientId: "suitew8zkh41ltgnypjgl", // 应用ID(唯一标识)
rpcScope: "Contact.User.Read",
fieldScope: "Contact.User.mobile",
type: 0,
ext: JSON.stringify({}),
from: "",
},
});
},
onShow(e) {
disposeAuthData((options) => {
if (options.status == 'ok') {
dd.setStorage({
key: 'grantAuth',
data: 'success'
})
login()
}
});
},
onHide(){
offAuthListener();
},
onUnload() {
offAuthListener();
},
openCancelPage() {
return openAuthMiniApp({
path: "pages/cancel/index", // 不要改
panelHeight: "percent50",
extraData: {
clientId: "suitew8zkh41ltgnypjgl", // 应用ID(唯一标识)
rpcScope: "Contact.User.Read",
fieldScope: "Contact.User.mobile",
type: 0,
ext: JSON.stringify({}),
from: "",
},
success: (res) => {
console.log(JSON.stringify(res));
},
fail: (res) => {
console.log(JSON.stringify(res));
},
});
},
onShareAppMessage() {
// 返回自定义分享信息
return {
title: 'My App',
desc: 'My App description',
path: 'pages/index/index',
};
},
});
{
"usingComponents": {
"search-bar": "mini-ali-ui/es/search-bar/index"
},
"allowsBounceVertical": "NO"
}
\ No newline at end of file
.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-content .am-list-content{
flex: unset;
}
.row-extra {
flex-basis: initial;
font-size: 32rpx;
color: #888;
flex: 1;
text-align: right;
}
.row-arrow {
width: 32rpx;
height: 32rpx;
margin-left: 16rpx;
}
\ No newline at end of file
<view>
<list>
<view slot="header">
柜门钥匙列表
</view>
<block a:for="{{carList}}">
<list-item thumb={{item.carNumber? "../../src/assets/hasKey.png" : "../../src/assets/noKey.png"}}
index="{{index}}"
arrow="{{false}}"
last="{{index === (carList.length - 1)}}"
class="row-content"
key="{{index}}">
{{item.device_name}}-{{item.name}}
<view
slot="extra" class="row-extra">
<view>
{{item.carNumber}}
</view>
<tag a:if ={{item.state ==="订单中"}} size="sm" type="primary">{{item.state}}</tag>
<tag a:if ={{item.state ==="正常"}} size="sm" type="success">{{item.state}}</tag>
<tag a:if ={{item.state ==="空箱"}} size="sm" type="success">{{item.state}}</tag>
</view>
</list-item>
</block>
</list>
</view>
import dd from 'gdt-jsapi';
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
carList: []
},
onLoad(query) {
this.getCarList()
},
getCarList () {
const _this = this
http.post(getApp().globalData.service + "/api/T_Equipment/CarList", {tenant_id: getApp().globalData.tenantId}).then(res => {
if (res.Success) {
_this.setData({
carList: res.result
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
onPullDownRefresh() {
// 页面被下拉
this.getCarList();
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
});
{
"defaultTitle": "钥匙监控",
"usingComponents": {
"list": "mini-ali-ui/es/list/index",
"list-item": "mini-ali-ui/es/list/list-item/index",
"tag": "mini-ali-ui/es/tag/index"
}
}
.grid {
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;
}
.grid-item-wrapper {
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;
}
.grid-text {
color: #696969;
font-size: 28rpx;
line-height: 1;
margin-top: 28rpx;
}
.mgt15 {
margin-top: 15rpx;
}
\ No newline at end of file
<view class="page-container">
<!--顶部-->
<top personalGeneralInfo="{{personalGeneralInfo}}" insInfo='{{insInfo}}'/>
<!-- 订单 -->
<view class="mgt15" a:if="{{showOrder}}">
<container title="我的订单" thumb="../../src/assets/order.png" icon="arrow" onActionTap="showOrder">
<view class="grid" key="grid">
<view a:for="{{list}}" key="{{item.entitle}}" class="grid-item" onTap="onItemTap" data-index="{{index}}">
<view class="grid-item-wrapper">
<image src="{{item.icon}}" class="grid-icon" mode="aspectFit" />
<text class="grid-text">{{item.title}}</text>
</view>
</view>
</view>
</container>
</view>
<!--列表-->
<view class="mgt15">
<list>
<block a:for="{{menuList}}">
<list-item key="{{index}}" thumb="{{item.thumb}}" arrow="right" onClick="handleMenuTap" data-info="{{item.page}}">{{ item.title }}</list-item>
</block>
</list>
</view>
</view>
\ No newline at end of file
import { JY_MENU_QUERY, SHY_MENU_QUERY, SYS_MENU_QUERY, BMD_MENU_QUERY } from '../../src/common/constant';
import dd from 'gdt-jsapi';
Page({
data: {
radius: true,
personalGeneralInfo: {},
showOrder: true,
list: [
{
entitle: '待我审批',
icon: '../../src/assets/wait.png',
page: '../orderList/orderList?arrIndex=0',
title: '待我审批'
},
{
entitle: '我的申请',
icon: '../../src/assets/wait.png',
page: '../orderList/orderList?arrIndex=0',
title: '我的申请'
},
{
entitle: '审批通过',
icon: '../../src/assets/disagree.png',
page: '../orderList/orderList?arrIndex=1',
title: '审批通过'
},
{
entitle: '订单完成',
icon: '../../src/assets/finish.png',
page: '../orderList/orderList?arrIndex=3',
title: '订单完成'
},
],
menuList: []
},
handleMenuTap(e) {
dd.navigateTo({
url: e.target.dataset.info
})
},
showOrder() {
dd.navigateTo({
url: '../orderList/orderList'
})
},
onItemTap(event) {
let index = event.target.dataset.index
dd.navigateTo({
url: this.data.list[index].page
})
},
onLoad() {
let myMenu = []
if (getApp().globalData.userInfo.roleCodeList.find(i => i ==='gly')) {
myMenu = myMenu.concat(SYS_MENU_QUERY)
}
if (getApp().globalData.userInfo.roleCodeList.find(i => i ==='jy')) {
myMenu = myMenu.concat(JY_MENU_QUERY)
}
if (getApp().globalData.userInfo.roleCodeList.find(i => i ==='ld')) {
myMenu = myMenu.concat(SHY_MENU_QUERY)
}
if (getApp().globalData.userInfo.roleCodeList.find(i => i ==='bmd')) {
myMenu = myMenu.concat(BMD_MENU_QUERY)
this.setData({
showOrder: false
})
}
let obj = {}
let result = myMenu.reduce((item, next) => {
obj[next.thumb] ? '' : obj[next.thumb] = true && item.push(next)
return item
}, [])
this.setData({
personalGeneralInfo: {
userName: getApp().globalData.userInfo.name,
company: getApp().globalData.userInfo.sysDepart.departName,
avatar: getApp().globalData.userInfo.avatar
},
menuList: result
});
},
});
{
"defaultTitle": "我的",
"component": false,
"usingComponents": {
"list": "mini-ali-ui/es/list/index",
"list-item": "mini-ali-ui/es/list/list-item/index",
"container": "mini-ali-ui/es/container/index",
"title": "mini-ali-ui/es/title/index",
"top": "../../src/components/top/top"
},
"allowsBounceVertical": "NO"
}
\ No newline at end of file
.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: 16rpx;
}
.container {
background: #F5F5F5;
padding: 24rpx;
height: 100%;
}
.container-item {
margin-bottom: 10rpx;
}
.item {
background: #eeeeee;
text-align: left;
height: 220rpx;
padding-top: 5rpx;
}
.item-concent{
padding: 10rpx 10rpx;
font-size: 30rpx;
}
.txte-warn{
margin-left: 12rpx;
color: #FF8C00;
font-size: 30rpx;
}
.txte-success{
margin-left: 12rpx;
color: #67c23a;
font-size: 28rpx;
}
.txte-danger{
margin-left: 12rpx;
color: #f56c6c;
font-size: 28rpx;
}
\ No newline at end of file
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<view>
<picker onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{stateObjectArray}}" range-key="name">
<view class="row">
<view class="row-title">选择订单状态</view>
<view class="row-extra">当前选择:{{stateObjectArray[arrIndex].name}}</view>
<image class="row-arrow" src="https://img.alicdn.com/tfs/TB1oVprf4vbeK8jSZPfXXariXXa-48-48.png" mode="aspectFill" />
</view>
</picker>
</view>
<page-result
type="empty"
brief ="当前并无订单数据"
local="{{false}}" a:if='{{orderList.length === 0}}'/>
<view a:for="{{orderList}}" a:else>
<view className="container">
<container className="container-item" title = '{{item.realname}}发起的用车申请'
icon="arrow"
thumb="{{ item.returnTime ? (item.returnTime > item.end_time) ? '../../src/assets/overtime.png' : '../../src/assets/car.png' : '../../src/assets/car.png' }}"
onActionTap = "showPage" data-id="{{item.id}}">
<view class="item" onTap="showPage" data-id="{{item.id}}">
<view class="item-concent">订单编号: {{item.borrow_code}}</view>
<view class="item-concent">用车时间: {{item.start_time}}</view>
<view class="item-concent">车辆: {{ item.detailsList ? item.detailsList[0].carNumber : ''}}</view>
<view class="item-concent">订单状态:
<text class="txte-warn">{{ item.stateValue }}</text>
</view>
</view>
</container>
</view>
</view>
</scroll-view>
import http from '../../src/http'
import util from '../../src/libs/util';
import dd from 'gdt-jsapi';
Page({
data: {
stateObjectArray: [
{
id: 1,
name: '待审批'
},
{
id: 2,
name: '待派车'
},
{
id: 3,
name: '待取车'
},
{
id: 4,
name: '待归还'
},
{
id: 5,
name: '已完成'
},
{
id: 6,
name: '驳回'
},
{
id: 7,
name: '全部'
},
],
arrIndex: 6,
pageNo: 1,
pageSize: 10
},
onLoad(query) {
if (query.arrIndex) {
this.setData({
arrIndex: query.arrIndex
});
}
this.getOrderList()
},
getOrderList() {
let state = this.data.stateObjectArray[this.data.arrIndex].id
let data = {
pageNo: this.data.pageNo,
pageSize: this.data.pageSize,
type: 0,
state: state === 7 ? '' : state,
userid: getApp().globalData.userInfo.userId
}
http.post(getApp().globalData.service + '/api/T_Borrow/GetPageList', data).then(res => {
if (res.Success) {
this.setData({
orderList: res.result.records
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
bindObjPickerChange(e) {
this.setData({
arrIndex: e.detail.value,
pageSize: 10
});
this.getOrderList()
},
onPullDownRefresh() {
this.setData({
pageSize: 10
})
this.getOrderList()
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
showPage(event) {
let _id = event.target.dataset.id
dd.navigateTo({
url: '../orderDetail/orderDetail?id=' + _id
})
},
onScrollToLower(e) {
const _this = this
_this.setData({
pageSize: _this.data.pageSize + 8
})
this.getOrderList();
},
});
{
"defaultTitle": "我的申请",
"usingComponents": {
"page-result": "mini-ali-ui/es/page-result/index",
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"button": "mini-ali-ui/es/button/index",
"container": "mini-ali-ui/es/container/index",
"title": "mini-ali-ui/es/title/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
.am-title {
padding:var(--am-title-paddingLR,12px) var(--am-title-paddingB,12px)
}
.demo-steps-class {
margin-bottom: 20rpx;
}
.am-tabs-content-wrap {
background-color:#f1f1f1
}
.form-row {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 0 30rpx;
margin-top: 15rpx;
background-color:#fff
}
.form-row-label {
width: 45%;
font-size: 26rpx;
margin: 10rpx;
text-align: left;
color: #000;
}
.form-row-label-single {
width: 45%;
padding: 20rpx 10rpx;
font-size: 31rpx;
text-align: left;
color: #000;
}
.form-row-label-all {
width: wrap;
padding: 20rpx 10rpx;
font-size: 26rpx;
text-align: left;
color: #000;
}
.form-line {
height: 1px;
background-color: #ddd;
margin-left: 30rpx;
}
.row-arrow {
width: 25rpx;
height: 25rpx;
margin-left: 10rpx;
margin-top: 10rpx;
}
.txte-tip {
font-size: 31rpx;
color: #ff834c;
}
.submit-approve-btn {
width: 80%;
border-radius: 20rpx;
margin-left: 40rpx;
}
\ No newline at end of file
<view>
<title style="margin-top: 20rpx">基本信息</title>
<view class="form-row">
<view class="form-row-label-single">用车单号:</view>
<view class="form-row-label-single">{{orderInfo.borrow_code}}</view>
<view class="form-row-label-single">申请人:</view>
<view class="form-row-label-single">{{orderInfo.realname}}</view>
<view class="form-row-label-single">目的地:</view>
<view class="form-row-label-single">{{orderInfo.destination}}</view>
<view class="form-row-label-single">派车状态:</view>
<text class="form-row-label-single txte-tip" a:if="{{orderInfo.state === 0}}">待审批</text>
<text class="form-row-label-single txte-tip" a:if="{{orderInfo.state === 1}}">待取车</text>
<text class="form-row-label-single txte-tip" a:if="{{orderInfo.state === 2}}">待还车</text>
<text class="form-row-label-single txte-tip" a:if="{{orderInfo.state === 3}}">已完成</text>
<text class="form-row-label-single txte-tip" a:if="{{orderInfo.state === 4}}">驳回</text>
<view class="form-row-label-single">开始用车时间:</view>
<view class="form-row-label-single">{{orderInfo.start_time}}</view>
<view class="form-row-label-single">预计返回时间:</view>
<view class="form-row-label-single">{{orderInfo.end_time}}</view>
<view class="form-row-label-single">工作内容:</view>
<view class="form-row-label-single">{{orderInfo.reason}}</view>
<view class="form-row-label-single">备注:</view>
<view class="form-row-label-single">{{orderInfo.bz}}</view>
<block a:if="{{orderInfo.state !== 0}}">
<view class="form-row-label-single">车辆:</view>
<view class="form-row-label-single">{{orderInfo.carNumber}}</view>
</block>
</view>
<picker onChange="carPickerChange" value="{{index}}" range="{{carNumberList}}" a:if="{{orderInfo.state == 0}}">
<view class="form-row">
<view class="form-row-label-single">车辆:</view>
<view class="form-row-label-single">{{carNumberList[index] ? carNumberList[index] : '请选择车辆'}}
<image class="row-arrow" src="http://122.112.148.157:5000/updateImg/箭头下.png" mode="aspectFill"></image>
</view>
</view>
</picker>
<view a:if={{orderInfo.state !== 0}}>
<title style="margin-top: 20rpx">审批信息</title>
<view class="form-row">
<view class="form-row-label-single">审批人:</view>
<view class="form-row-label-single">{{orderInfo.sh_username}}</view>
<view class="form-row-label-single">审批意见:</view>
<view class="form-row-label-single">{{orderInfo.sh_idea}}</view>
<view class="form-row-label-single">审批时间:</view>
<view class="form-row-label-single">{{orderInfo.sh_time}}</view>
</view>
</view>
<view a:if={{orderInfo.state === 3 || orderInfo.state === 2}}>
<title style="margin-top: 20rpx">用车信息</title>
<view class="form-row">
<view class="form-row-label-single">取车时间:</view>
<view class="form-row-label-single">{{orderInfo.pickTime}}</view>
<view class="form-row-label-single">还车时间:</view>
<view class="form-row-label-single">{{orderInfo.returnTime}}</view>
</view>
</view>
<view a:if={{showSubmit}}>
<title style="margin-top: 20rpx">审核意见</title>
<multi-liner placeholder="请输入审核意见" value="{{shIdea}}" onInput="onInput" last="{{true}}" auto-height="{{true}}" controlled="{{true}}"/>
<view class="page-submit">
<flex>
<flex-item><button type="ghost" size="mini" class="submit-approve-btn" onTap="agree" data-result="no">拒绝</button></flex-item>
<flex-item><button type="primary" size="mini" class="submit-approve-btn" onTap="agree" data-result="yes">同意</button></flex-item>
</flex>
</view>
</view>
</view>
\ No newline at end of file
import http from '../../src/http'
import util from '../../src/libs/util';
Page({
data: {
orderInfo: {},
shIdea: '',
id: '',
carNumberList: [],
carList: [],
equipment_id: '',
showSubmit: false
},
onLoad(query) {
if (query.id) {
this.setData({
id: query.id
})
this.getCarList(query.id)
}
},
getById(id) {
const _this = this
http.post(getApp().globalData.service + '/api/T_Borrow/GetId', {id:id}).then(res => {
if (res.Success) {
let index = _this.data.carNumberList.findIndex(i => i === res.result.carNumber)
this.setData({
orderInfo: res.result,
index: index,
equipment_id: _this.data.carList[index] ? _this.data.carList[index].carId : '',
showSubmit: res.result.state === 0 && getApp().globalData.userInfo.roleCodeList.find(i => i === 'ld') ? true : false
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
onInput (e) {
this.setData({
shIdea: e.detail.value,
});
},
agree (event) {
const result = event.target.dataset.result
let formData = {
id: this.data.id,
sh_idea: this.data.shIdea ? this.data.shIdea : result === 'yes' ? '同意' : '驳回',
sh_userid: getApp().globalData.userInfo.userId,
type: result === 'yes' ? 0 : 1,
equipment_id: this.data.equipment_id
}
http.post(getApp().globalData.service + '/api/T_Borrow/Approve', formData).then(res => {
if (res.Success) {
dd.navigateTo({
url: '../orderList/orderList'
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
getCarList(id) {
const _this = this
// http.post(getApp().globalData.service + "/api/T_Equipment/CarList", {tenant_id: getApp().globalData.tenantId}).then(res => {
// if (res.Success) {
// _this.setData({
// carNumberList: res.result.filter(i => i.state === '正常').map(j => {return j.carNumber}),
// carList: res.result.filter(i => i.state === '正常')
// })
this.getById(id)
// } else {
// util.ddToast({ type: 'fail', text: res.Message })
// }
//})
},
carPickerChange(e) {
this.setData({
index: e.detail.value,
equipment_id: this.data.carList[e.detail.value].carId
});
},
});
{
"usingComponents": {
"button": "mini-ali-ui/es/button/index",
"title": "mini-ali-ui/es/title/index",
"card": "mini-ali-ui/es/card/index",
"list": "mini-ali-ui/es/list/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",
"multi-liner": "mini-ali-ui/es/multi-liner/index"
},
"allowsBounceVertical": "NO"
}
.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: 16rpx;
}
.container {
background: #F5F5F5;
padding: 24rpx;
height: 100%;
}
.container-item {
margin-bottom: 10rpx;
}
.item {
background: #eeeeee;
text-align: left;
height: 220rpx;
padding-top: 5rpx;
}
.item-concent{
padding: 10rpx 10rpx;
font-size: 30rpx;
}
.txte-warn{
margin-left: 12rpx;
color: #FF8C00;
font-size: 30rpx;
}
.txte-success{
margin-left: 12rpx;
color: #67c23a;
font-size: 28rpx;
}
.txte-danger{
margin-left: 12rpx;
color: #f56c6c;
font-size: 28rpx;
}
\ No newline at end of file
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<view>
<picker onChange="bindObjPickerChange" value="{{arrIndex}}" range="{{stateObjectArray}}" range-key="name">
<view class="row">
<view class="row-title">选择订单状态</view>
<view class="row-extra">当前选择:{{stateObjectArray[arrIndex].name}}</view>
<image class="row-arrow" src="https://img.alicdn.com/tfs/TB1oVprf4vbeK8jSZPfXXariXXa-48-48.png" mode="aspectFill" />
</view>
</picker>
</view>
<page-result
type="empty"
brief ="当前并无订单数据"
local="{{false}}" a:if='{{orderList.length === 0}}'/>
<view a:for="{{orderList}}" a:else>
<view className="container">
<container className="container-item" title = '{{item.realname}}发起的用车审批'
icon="arrow"
thumb="{{ item.returnTime ? (item.returnTime > item.end_time) ? '../../src/assets/overtime.png' : '../../src/assets/car.png' : '../../src/assets/car.png' }}"
onActionTap = "showPage" data-id="{{item.id}}">
<view class="item" onTap="showPage" data-id="{{item.id}}">
<view class="item-concent">订单编号: {{item.borrow_code}}</view>
<view class="item-concent">用车时间: {{item.start_time}}</view>
<view class="item-concent">车辆: {{item.carNumber}}</view>
<view class="item-concent">订单状态:
<text class="txte-warn" a:if="{{item.state === 0}}">待审批</text>
<text class="txte-warn" a:if="{{item.state === 1}}">待取车</text>
<text class="txte-warn" a:if="{{item.state === 2}}">待归还</text>
<text class="txte-success" a:if="{{item.state === 3}}">已完成</text>
<text class="txte-danger" a:if="{{item.state === 4}}">驳回</text>
</view>
</view>
</container>
</view>
</view>
</scroll-view>
import http from '../../src/http'
import util from '../../src/libs/util';
import login from '../../src/api/login';
Page({
data: {
stateObjectArray: [
{
id: 1,
name: '待审批'
},
{
id: 2,
name: '待派车'
},
{
id: 3,
name: '待取车'
},
{
id: 4,
name: '待归还'
},
{
id: 5,
name: '已完成'
},
{
id: 6,
name: '驳回'
},
{
id: 7,
name: '全部'
},
],
arrIndex: 5,
pageNo: 1,
pageSize: 10
},
onLoad(query) {
if (query.arrIndex) {
this.setData({
arrIndex: query.arrIndex
});
}
this.getOrderList()
},
getOrderList() {
let state = this.data.stateObjectArray[this.data.arrIndex].id
let data = {
pageNo: this.data.pageNo,
pageSize: this.data.pageSize,
type: 0,
userid: getApp().globalData.userInfo.userId
}
http.post(getApp().globalData.service + '/api/T_Borrow/GetPageList', data).then(res => {
if (res.Success) {
this.setData({
orderList:res.result.records
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
bindObjPickerChange(e) {
this.setData({
arrIndex: e.detail.value,
pageSize: 10
});
this.getOrderList()
},
onPullDownRefresh() {
this.setData({
pageSize: 10
})
this.getOrderList()
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
showPage(event) {
let _id = event.target.dataset.id
dd.navigateTo({
url: '../orderDetail/orderDetail?id=' + _id
})
},
onScrollToLower(e) {
const _this = this
_this.setData({
pageSize: _this.data.pageSize + 8
})
this.getOrderList();
},
});
{
"defaultTitle": "我的订单",
"usingComponents": {
"page-result": "mini-ali-ui/es/page-result/index",
"tabs": "mini-ali-ui/es/tabs/index",
"tab-content": "mini-ali-ui/es/tabs/tab-content/index",
"button": "mini-ali-ui/es/button/index",
"container": "mini-ali-ui/es/container/index",
"title": "mini-ali-ui/es/title/index",
"flex": "mini-ali-ui/es/flex/index",
"flex-item": "mini-ali-ui/es/flex/flex-item/index"
}
}
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 90vh;" onScrollToLower="onScrollToLower">
<search-bar value="{{searchValue}}" focus="{{true}}" maxLength="{{20}}" showVoice="{{false}}" placeholder="搜索" onInput="handleInput"
onSubmit="searchSubmit"
onClear="handleClear"
showCancelButton="{{false}}" />
<page-result
type="empty"
brief ="当前并无车辆数据"
local="{{false}}" a:if='{{carList.length === 0}}'/>
<view a:for="{{carList}}" a:else>
<list-item>
<view slot="extra">
<button size="mini" type="primary" onTap="editCar" data-info="{{item}}">编辑</button>
</view>
<avatar name="{{item.carNumber}}" desc="{{item.carType}}" src="http://122.112.148.157:5000/updateImg/汽车.png" />
</list-item>
</view>
<view class="page-submit">
<button type="primary" formType="submit" class="submit-btn" onTap="addCar">新增</button>
</view>
</scroll-view>
\ No newline at end of file
import http from '../../src/http/index'
import util from '../../src/libs/util'
Page({
data: {
pageNo: 1,
pageSize: 10,
searchValue: ''
},
onLoad() {
this.setData({
userId: getApp().globalData.userInfo.userId
})
this.getCarList()
},
handleInput(value) {
this.setData({
searchValue: value,
});
},
handleClear() {
this.setData({
searchValue: '',
});
this.getCarList()
},
searchSubmit() {
this.getCarList()
},
getCarList() {
let data = {
pageNo: this.data.pageNo,
pageSize: this.data.pageSize,
tenant_id: getApp().globalData.tenantId,
carNumber: this.data.searchValue
}
http.post(getApp().globalData.service + '/api/T_Equipment/EquipmentPageList', data).then(res => {
if (res.Success) {
this.setData({
carList: res.result.records
})
} else {
util.ddToast({ type: 'fail', text: res.Message })
}
})
},
onPullDownRefresh() {
this.setData({
pageSize: 10
})
this.getCarList()
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onScrollToLower(e) {
const _this = this
_this.setData({
pageSize: _this.data.pageSize + 8
})
this.getCarList();
},
addCar() {
dd.redirectTo({
url: '../addCar/addCar'
})
},
editCar(e) {
let car = e.target.targetDataset.info
dd.redirectTo({
url: '../addCar/addCar?id=' +car.id + '&carNumber=' + car.carNumber + '&carType=' + car.carType
})
}
});
{
"defaultTitle": "车辆管理",
"usingComponents": {
"page-result": "mini-ali-ui/es/page-result/index",
"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"
}
}
.rectangle {
//position: fixed;
//top: 100px;
padding: 0 14px;
margin-top: 20px;
}
.dialog {
position: fixed;
bottom: 18px;
}
.content {
color: #fff;
}
.opt-button {
width: 51px;
height: 27px;
display: flex;
justify-content: center;
align-items: center;
color: #fff;
font-size: 12px;
border: #68BAF7 solid 1rpx;
}
.add-home {
width: 72px;
height: 27px;
display: flex;
justify-content: center;
align-items: center;
background-color: #56ADEB;
color: #fff;
font-size: 14px;
}
.am-tips-dialog .am-button {
border: none;
}
.row {
display: flex;
align-items: center;
padding: 0 30rpx;
background-color: white;
}
.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;
margin-right: 12px;
}
\ No newline at end of file
<view>
<tips-dialog iconUrl="{{useIcon ? 'https://gw.alipayobjects.com/zos/rmsportal/AzRAgQXlnNbEwQRvEwiu.png' : ''}}"
iconSize="36"
type="rectangle"
className="rectangle"
onCloseTap="onCloseTap"
show="{{showRectangle}}"
arrowPosition="{{arrowPositions[arrowPosIndex]}}">
<view class="content"
slot="content">
选错单位,是否重新选择?
</view>
<am-button a:if="{{useButton}}"
slot="operation"
shape="capsule"
capsuleSize="small"
onTap="onRectangleTap">立即选择</am-button>
<!-- <view slot="operation" class="add-home" onTap="onRectangleTap">立即添加</view> -->
</tips-dialog>
</view>
\ No newline at end of file
import util from '../../src/libs/util.js';
Page({
data: {
showRectangle: false,
showDialog: true,
arrowPositions: [
'bottom-left',
'bottom-center',
'bottom-right',
'top-left',
'top-center',
'top-right',
'left',
'right',
],
arrowPosIndex: 3,
useButton: true,
},
onLoad() {
if (getApp().globalData.userInfo.roleCodeList.find(i => i === 'jy')) {
this.setData({
showRectangle: true
})
}
},
onCloseTap() {
this.setData({
showRectangle: false,
});
},
onRectangleTap() {
util.db.remove('appInfo').then(res => {
dd.navigateTo({
url: '../index/index'
})
})
},
});
{
"defaultTitle": "设置",
"usingComponents": {
"tips-dialog": "mini-ali-ui/es/tips/tips-dialog/index",
"am-button": "mini-ali-ui/es/button/index",
"am-icon": "mini-ali-ui/es/am-icon/index",
"list-item": "mini-ali-ui/es/list/list-item/index",
"input-item": "mini-ali-ui/es/input-item/index"
}
}
<scroll-view scroll-y="{{true}}" enable-back-to-top="{{true}}" style="height: 100vh;" onScrollToLower="onScrollToLower">
<search-bar value="{{searchValue}}" focus="{{true}}" maxLength="{{20}}" showVoice="{{false}}" placeholder="搜索" onInput="handleInput"
onSubmit="searchSubmit"
onClear="handleClear"
showCancelButton="{{false}}" />
<page-result
type="empty"
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>
</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'
Page({
data: {
pageNo: 1,
pageSize: 10,
searchValue: '',
roleList: [
{roleId: 'e51758fa916c881624b046d26bd09230', name: '领导'},
{roleId: '1429329085694271710', name: '白名单'},
{roleId: '1429329085699571714', name: '普通用户'},
],
modalOpened: false,
buttons: [
{ text: '取消' },
{ text: '确定', extClass: 'buttonBold' },
],
},
onLoad() {
this.setData({
userId: getApp().globalData.userInfo.userId
})
this.getUserList()
},
handleInput(value) {
this.setData({
searchValue: value,
});
},
handleClear() {
this.setData({
searchValue: '',
});
this.getUserList()
},
searchSubmit() {
this.getUserList()
},
onModalClick() {
this.setData({
qrCodeModal: false,
});
},
onModalClose() {
this.setData({
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 => {
if (res.success) {
this.setData({
userList: res.result.records
})
} else {
util.ddToast({ type: 'fail', text: res.message })
}
})
},
onPullDownRefresh() {
this.setData({
pageSize: 10
})
this.getUserList()
setTimeout(() => {
dd.stopPullDownRefresh();
}, 100);
},
onScrollToLower(e) {
const _this = this
_this.setData({
pageSize: _this.data.pageSize + 8
})
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 })
}
})
},
})
}
},
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,
})
})
}
}
});
{
"defaultTitle": "用户管理",
"usingComponents": {
"page-result": "mini-ali-ui/es/page-result/index",
"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"
}
}
import http from '../http';
import util from '../libs/util';
import dd from 'gdt-jsapi';
function login() {
getApp().globalData.userInfo = {userId: '15957116480', name: '黄麒宇', roleCodeList: ['jy'],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 })
// }
// })
// }
// })
}
export default login
// 首页底部文案
export const ABOUT_COPY = {
copy: '本服务由浙江钧普科技股份有限公司提供',
telTitle: '当前版本号:',
tel: 'V1.0.6',
};
export const JY_MENU_QUERY = [
{
thumb: '../../src/assets/carApply.png',
page: '../applyBorrowCar/applyBorrowCar',
title: '用车申请'
},
{
thumb: '../../src/assets/myApply.png',
page: '../myApply/myApply',
title: '我的申请'
},
{
thumb: '../../src/assets/carUseLog.png',
page: '../carUseLog/carUseLog',
title: '用车记录'
},
]
export const SHY_MENU_QUERY = [
{
thumb: '../../src/assets/monitor.png',
page: '../keyList/keyList',
title: '钥匙监控'
},
{
thumb: '../../src/assets/carUseLog.png',
page: '../carUseLog/carUseLog',
title: '用车记录'
},
{
thumb: '../../src/assets/tj.png',
page: '../carTj/carTj',
title: '用车统计'
},
]
export const SYS_MENU_QUERY = [
{
thumb: '../../src/assets/user.png',
page: '../sysUser/sysUser',
title: '用户管理'
},
{
thumb: '../../src/assets/car.png',
page: '../sysCar/sysCar',
title: '车辆管理'
},
{
thumb: '../../src/assets/carApply.png',
page: '../applyBorrowCar/applyBorrowCar',
title: '用车申请'
},
{
thumb: '../../src/assets/carUseLog.png',
page: '../carUseLog/carUseLog',
title: '用车记录'
},
{
thumb: '../../src/assets/monitor.png',
page: '../keyList/keyList',
title: '钥匙监控'
},
]
export const BMD_MENU_QUERY = [
{
thumb: '../../src/assets/carUseLog.png',
page: '../carUseLog/carUseLog',
title: '用车记录'
}
]
\ No newline at end of file
@charset "utf-8";
.borderBottomDDD {
border-bottom: 1rpx solid #ddd;
}
.borderTopDDD {
border-top: 1rpx solid #ddd;
}
.top-wrapper {
background-color: #2074D4;
}
.top-wrapper .top-title {
padding: 10rpx 36rpx 40rpx 36rpx;
}
.top-wrapper .top-title .auth-btn {
text-align: center;
margin: auto 36rpx;
padding: 24rpx 32rpx;
border: 1rpx solid #fff;
border-radius: 4rpx;
}
.top-wrapper .top-title .auth-btn .auth-title {
color: #fff;
opacity: 1;
font-size: 32rpx;
}
.top-wrapper .top-title .auth-btn .auth-info {
margin-top: 7rpx;
font-size: 24rpx;
color: #F0F7FF;
opacity: 0.6;
}
.top-wrapper .top-title .top-content {
display: flex;
justify-content: space-between;
color: #fff;
}
.top-wrapper .top-title .top-content .left-content .name {
font-size: 40rpx;
}
.top-wrapper .top-title .top-content .left-content .company {
font-size: 30rpx;
opacity: 0.8;
}
.top-wrapper .top-title .top-content .right-content {
display: flex;
width: 0.5rem;
justify-content: flex-end;
align-items: center;
}
.top-wrapper .top-title .top-content .right-content image {
width: 16rpx;
height: 29rpx;
}
.top-wrapper .top-status {
display: flex;
justify-content: flex-start;
padding: 0 32rpx 66rpx 32rpx;
}
.am-list-extra {
flex: 1;
}
.top-icon {
width: 70rpx;
height: 70rpx;
margin: 10rpx 20rpx 0rpx 0rpx;
}
<!--顶部-->
<view class="top-wrapper" a:if="{{personalGeneralInfo}}">
<list-item>
<!-- <view slot="extra">
<image src="http://122.112.148.157:5000/updateImg/scan.png" class="top-icon" mode="aspectFit" onTap="onTap"/>
</view> -->
<avatar name="{{personalGeneralInfo.userName}}" desc="{{personalGeneralInfo.company}}" src="{{personalGeneralInfo.avatar}}" />
</list-item>
</view>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论