Bläddra i källkod

Merge branch 'master' of http://git.ringzle.com:3000/liwei2496/wit-uniapp

yanggang 2 år sedan
förälder
incheckning
c575330251

+ 86 - 0
components/t-table/t-table.vue

@@ -0,0 +1,86 @@
+<template>
+	<view class="t-table" :style="{ 'border-width': border + 'px', 'border-color': borderColor }">
+		<slot />
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			border: {
+				type: String,
+				default: '1'
+			},
+			borderColor: {
+				type: String,
+				default: '#d0dee5'
+			},
+			isCheck: {
+				type: Boolean,
+				default: false
+			}
+		},
+		provide() {
+			return {
+				table: this
+			};
+		},
+		data() {
+			return {};
+		},
+		created() {
+			this.childrens = [];
+			this.index = 0;
+		},
+		methods: {
+			fire(e, index, len) {
+				let childrens = this.childrens;
+				console.log(childrens);
+				// 全选
+				if (index === 0) {
+					childrens.map((vm, index) => {
+						vm.checkboxData.checked = e;
+						return vm;
+					});
+				} else {
+					let isAll = childrens.find((n, ids) => ids !== 0 && !n.checkboxData.checked);
+					childrens[0].checkboxData.checked = isAll ? false : true;
+				}
+
+				let fireArr = [];
+				for (let i = 0; i < childrens.length; i++) {
+					if (childrens[i].checkboxData.checked && i !== 0) {
+						fireArr.push(childrens[i].checkboxData.value - 1);
+					}
+				}
+				this.$emit('change', {
+					detail: fireArr
+				});
+			}
+		}
+	};
+</script>
+
+<style scoped>
+	.t-table {
+		width: 100%;
+		border: 1px #d0dee5 solid;
+		border-left: none;
+		border-top: none;
+		box-sizing: border-box;
+	}
+
+	.t-table>>>t-tr {
+		display: flex;
+	}
+
+	.t-table>>>t-tr:nth-child(2n) {
+		background: #f5f5f5;
+	}
+
+	/* #ifdef H5 */
+	.t-table>>>.t-tr:nth-child(2n) {
+		background: #f5f5f5;
+	}
+	/* #endif */
+</style>

+ 71 - 0
components/t-table/t-td.vue

@@ -0,0 +1,71 @@
+<template>
+	<view class="t-td" :style="{ 'border-width': thBorder + 'px','border-color':borderColor ,'font-size':fontSize+'px' ,'color':color,'justify-content':tdAlignCpd}">
+		<slot></slot>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			align: String
+		},
+		data() {
+			return {
+				thBorder: '1',
+				borderColor: '#d0dee5',
+				fontSize: '14',
+				color: '#555c60',
+				tdAlign: 'center'
+			};
+		},
+		inject: ['table', 'tr'],
+
+		created() {
+			this.thBorder = this.table.border;
+			this.borderColor = this.table.borderColor;
+			this.fontSize = this.tr.fontSize;
+			this.color = this.tr.color;
+			if (this.align) {
+				this.tdAlign = this.align;
+			} else {
+				this.tdAlign = this.tr.align
+			}
+		},
+		computed: {
+			tdAlignCpd() {
+				let nameAlign = '';
+				switch (this.tdAlign) {
+					case 'left':
+						nameAlign = 'flex-start'
+						break;
+					case 'center':
+						nameAlign = 'center'
+						break;
+					case 'right':
+						nameAlign = 'flex-end'
+						break;
+					default:
+						nameAlign = 'center'
+						break;
+				}
+				return nameAlign
+			}
+		}
+	};
+</script>
+
+<style>
+	.t-td {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		width: 100%;
+		padding: 14upx;
+		border-top: 1px #d0dee5 solid;
+		border-left: 1px #d0dee5 solid;
+		text-align: center;
+		color: #555c60;
+		font-size: 28upx;
+
+	}
+</style>

+ 71 - 0
components/t-table/t-th.vue

@@ -0,0 +1,71 @@
+<template>
+	<view class="t-th" :style="{ 'border-width': thBorder + 'px' ,'border-color':borderColor,'font-size':fontSize+'px' ,'color':color,'justify-content':thAlignCpd}">
+		<slot></slot>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			align: String,
+		},
+		data() {
+			return {
+				thBorder: '1',
+				borderColor: '#d0dee5',
+				fontSize: '15',
+				color: '#3b4246',
+				thAlign: 'center'
+			};
+		},
+		inject: ['table', 'tr'],
+
+		created() {
+			this.thBorder = this.table.border;
+			this.borderColor = this.table.borderColor;
+			this.fontSize = this.tr.fontSize;
+			this.color = this.tr.color;
+			if (this.align) {
+				this.thAlign = this.align;
+			} else {
+				this.thAlign = this.tr.align
+			}
+		},
+
+		computed: {
+			thAlignCpd() {
+				let nameAlign = '';
+				switch (this.thAlign) {
+					case 'left':
+						nameAlign = 'flex-start'
+						break;
+					case 'center':
+						nameAlign = 'center'
+						break;
+					case 'right':
+						nameAlign = 'flex-end'
+						break;
+					default:
+						nameAlign = 'center'
+						break;
+				}
+				return nameAlign
+			}
+		}
+	};
+</script>
+
+<style>
+	.t-th {
+		flex: 1;
+		display: flex;
+		align-items: center;
+		font-size: 30upx;
+		font-weight: bold;
+		text-align: center;
+		color: #3b4246;
+		border-left: 1px #d0dee5 solid;
+		border-top: 1px #d0dee5 solid;
+		padding: 15upx;
+	}
+</style>

+ 81 - 0
components/t-table/t-tr.vue

@@ -0,0 +1,81 @@
+<template>
+	<view class="t-tr">
+		<view v-if="isCheck" class="t-check-box" :style="{ 'border-width': thBorder + 'px' ,'border-color':borderColor}">
+			<checkbox-group @change="checkboxChange">
+				<checkbox :value="checkboxData.value + ''" :checked="checkboxData.checked" />
+			</checkbox-group>
+		</view>
+		<slot></slot>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			fontSize: String,
+			color: String,
+			align: String
+		},
+		inject: ['table'],
+		provide() {
+			return {
+				tr: this
+			};
+		},
+		data() {
+			return {
+				isCheck: false,
+				checkboxData: {
+					value: 0,
+					checked: false
+				},
+				checked: false,
+				thBorder: '1',
+				borderColor: '#d0dee5'
+			};
+		},
+		created() {
+			this.thBorder = this.table.border;
+			this.borderColor = this.table.borderColor;
+			this.table.childrens.push(this);
+			this.checkboxData.value = this.table.index++;
+			this.isCheck = this.table.isCheck;
+
+		},
+		methods: {
+			checkboxChange(e) {
+				this.checkboxData.checked = !this.checkboxData.checked;
+				this.table.childrens[this.checkboxData.value] = this;
+				this.table.fire(e.detail.value[0] ? true : false, this.checkboxData.value, this.table.index);
+			}
+		}
+	};
+</script>
+
+<style>
+	.t-tr {
+		width: 100%;
+		display: flex;
+	}
+
+	.t-tr t-th,
+	.t-tr t-td {
+		display: flex;
+		flex: 1;
+	}
+
+	.t-tr .t-check-box {
+		flex-shrink: 0;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		width: 80upx;
+		color: #3b4246;
+		border-left: 1px #d0dee5 solid;
+		border-top: 1px #d0dee5 solid;
+	}
+
+	.t-tr .t-check-box checkbox {
+		transform: scale(0.8);
+	}
+</style>

+ 3 - 2
http/index.js

@@ -20,10 +20,11 @@ export const $http = (url, method, data, json) => {
 		uni.hideLoading()
 		// 请根据后端规定的状态码判定
 		//  console.log('111111111111111111',response)
-		if (response.data.data.code === 401) {//token失效
+		if (response.data.code === 300) {//token失效
+		
 		//	return response.data = await doRequest(response, url)//动态刷新token,并重新完成request请求
 		}else{
-			if(response.data.code!==200&&response.data.msg){
+			if(response.data.code==10021&&response.data.msg){
 				uni.showToast({
 					title:response.data.msg,
 					icon:'none',

+ 22 - 2
pages.json

@@ -41,7 +41,9 @@
 		{
 			"path": "pages/Workorder/Workorder",
 			"style": {
-				"navigationBarTitleText": "管理"
+				"navigationBarTitleText": "工作台"
+			//	"navigationStyle": "custom" ,// 隐藏系统导航栏
+					//		"navigationBarTextStyle": "white" 
 			}
 		},
 		// {
@@ -139,6 +141,24 @@
             }
             
         }
+        ,{
+            "path" : "pages/Workorder/Tenantbill/Tenantbill",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "租户账单",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/Workorder/Remotecontrol/Remotecontrol",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "远程管控",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
@@ -172,7 +192,7 @@
 				"pagePath": "pages/Workorder/Workorder",
 				"iconPath": "static/tab/w1.png",
 							"selectedIconPath": "static/tab/w2.png",
-				"text": "管理"
+				"text": "工作台"
 			},			
 			// {
 			// 	"pagePath": "pages/Energyconsumption/Energyconsumption",

+ 22 - 0
pages/Workorder/Remotecontrol/Remotecontrol.vue

@@ -0,0 +1,22 @@
+<template>
+	<view>
+		Remotecontrol
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			}
+		},
+		methods: {
+			
+		}
+	}
+</script>
+
+<style>
+
+</style>

+ 267 - 0
pages/Workorder/Tenantbill/Tenantbill.vue

@@ -0,0 +1,267 @@
+<template>
+	<view class="billall">
+		<u-cell-group>
+			<u-cell :title="mytitle" value="修改" :isLink="true" @click="floorchange">
+				<u-icon slot="icon" size="40" name="map"></u-icon>
+			</u-cell>
+		</u-cell-group>
+		<view class="topbill">
+			<view class="topbilledit">
+				<view class="changetime1">
+					<picker mode="date" :value="myday" fields="month" @change="dateChange">
+						<view class="selestDate">{{myday}}</view>
+					</picker>
+				</view>
+				<view class="changetime2">
+					<u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
+				</view>
+			</view>
+			<view class="topbilledit" @click="typechange">
+				<view class="changetime1">
+					{{mytype}}
+				</view>
+				<view class="changetime2">
+					<u-icon name="arrow-down-fill" color="#666666" size="20"></u-icon>
+				</view>
+			</view>
+		</view>
+		<!-- 列表 -->
+		<t-table>
+			<t-tr>
+				<t-th>序号</t-th>
+				<t-th>姓名</t-th>
+				<t-th>年龄</t-th>
+				<t-th>爱好</t-th>
+				<t-th>操作</t-th>
+			</t-tr>
+			<t-tr v-for="item in tableList" :key="item.id">
+				<t-td>{{ item.id + 1 }}</t-td>
+				<t-td>{{ item.name }}</t-td>
+				<t-td>{{ item.age }}</t-td>
+				<t-td>{{ item.hobby }}</t-td>
+				  <t-td align="left"> <u-button @click="edit(item)"  size="small" type="primary" :plain="true" text="编辑"></u-button></t-td>
+				
+			</t-tr>
+		</t-table>
+
+
+
+
+
+		<u-picker :show="showtype" :columns="columnstype" keyName="label" @confirm="confirmtype" @cancel='canceltype'>
+		</u-picker>
+		<!-- 
+         <mx-date-picker :show="showPicker" type="range" :value="dayrange" :show-tips="true" :begin-text="'开始日期'" :end-text="'结束日期'" :show-seconds="true" @confirm="ed" @cancel="ec" /> -->
+
+		<u-picker :show="showfloor" ref="uPicker" :loading="loading" @confirm="confirmfloor" @cancel='cancelfloor'
+			:columns="columns" keyName="orgName" @change="changeHandler"></u-picker>
+		<u-notify ref="uNotify" :show="showdct" message="服务器请求失败"></u-notify>
+	</view>
+</template>
+
+<script>
+	// import MxDatePicker from "@/components/mx-datepicker/mx-datepicker.vue";
+	import tTable from '@/components/t-table/t-table.vue';
+	import tTh from '@/components/t-table/t-th.vue';
+	import tTr from '@/components/t-table/t-tr.vue';
+	import tTd from '@/components/t-table/t-td.vue';
+	export default {
+		components: {
+			//    MxDatePicker
+			tTable,
+			tTh,
+			tTr,
+			tTd
+		},
+		data() {
+			const currentDate = this.getDate({
+				format: 'yyyy-mm'
+			})
+			return {
+				tableList: [{
+						id: 0,
+						name: '张三',
+						age: '19',
+						hobby: '游泳'
+					},
+					{
+						id: 1,
+						name: '李四',
+						age: '21',
+						hobby: '绘画'
+					},
+					{
+						id: 2,
+						name: '王二',
+						age: '29',
+						hobby: '滑板'
+					},
+					{
+						id: 3,
+						name: '码字',
+						age: '20',
+						hobby: '蹦极'
+					}
+				],
+
+				showtype: false,
+				showdct: false,
+				mytitle: '',
+				alldata: [],
+				showfloor: false,
+				loading: false,
+				columns: [],
+				columnData: [],
+				myday: '',
+				mytype: '全部',
+				showPicker: false,
+				myday: currentDate,
+				columnstype: [
+					[{
+							label: '全部',
+							id: ''
+						}, {
+							label: '未结清',
+							id: 0
+						},
+						{
+							label: '已结清',
+							id: 1
+						}
+					]
+				],
+
+
+
+			}
+		},
+		//监听页面加载,其参数为上个页面传递的数据,参数类型为 Object(用于页面传参
+		onLoad() {
+			this.getfloor();
+
+		},
+		//监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
+		onReady() {
+			// 微信小程序需要用此写法
+
+		},
+
+		//监听页面隐藏
+		onHide() {},
+		//监听窗口尺寸变化
+		onResize() {},
+		//监听页面卸载
+		onUnload() {},
+		//监听用户下拉动作,一般用于下拉刷新
+		onPullDownRefresh() {},
+
+
+		methods: {
+			
+			edit(item) {
+				console.log('111111111111111111', item)
+			},
+			canceltype() {
+				this.showtype = false;
+			},
+			confirmtype(e) {
+				// console.log('111111111111111111',e.value[0])
+				this.showtype = false;
+				this.mytype = e.value[0].label
+			},
+			typechange() {
+				this.showtype = true;
+			},
+			dateChange(e) {
+				this.myday = e.target.value;
+			},
+			getDate(type) {
+				const date = new Date();
+				let year = date.getFullYear();
+				let month = date.getMonth() + 1;
+				if (type === 'start') {
+					year = year - 60;
+				} else if (type === 'end') {
+					year = year + 2;
+				}
+				month = month > 9 ? month : '0' + month;
+				// day = day > 9 ? day : '0' + day;
+				return `${year}-${month}`;
+			},
+			getfloor() {
+				this.$api.get('/control/getOrgStructureTree/', {})
+					.then(res => {
+
+						if (res.data.code == 0) {
+							this.mytitle = res.data.data[0].orgName;
+							this.alldata = res.data.data[0].childrenList;
+							//console.log('111111111111111111',  res.data.data[0].childrenList)			
+							this.columns = [
+								res.data.data[0].childrenList,
+								res.data.data[0].childrenList[0].childrenList
+							]
+							let allfloor = [];
+							for (let i = 0; i < res.data.data[0].childrenList.length; i++) {
+								allfloor.push(res.data.data[0].childrenList[i].childrenList)
+							}
+							//  console.log('111111111111111111',allfloor)
+							this.columnData = allfloor
+						} else {
+							this.showdct = true
+						}
+					})
+			},
+
+			floorchange() {
+				this.showfloor = true;
+			},
+			changeHandler(e) {
+				const {
+					columnIndex,
+					index,
+					// 微信小程序无法将picker实例传出来,只能通过ref操作
+					picker = this.$refs.uPicker
+				} = e
+				if (columnIndex === 0) {
+					this.loading = true
+					picker.setColumnValues(1, this.columnData[index])
+					this.loading = false
+				}
+			},
+			confirmfloor(e) {
+				console.log('222222', e.value)
+
+				this.mytitle = e.value[0].orgName + e.value[1].orgName;
+
+				this.showfloor = false;
+			},
+			cancelfloor() {
+				this.showfloor = false;
+			},
+
+
+		}
+	}
+</script>
+
+<style>
+	.billall {}
+
+	.topbill {
+		display: flex;
+		justify-content: space-around;
+		align-items: center;
+		height: 100rpx;
+		background-color: #e6e6e6;
+	}
+
+	.topbilledit {
+		display: flex;
+		justify-content: space-around;
+		align-items: center;
+	}
+
+	.changetime1 {
+		padding-right: 10rpx;
+	}
+</style>

+ 60 - 2
pages/Workorder/Workorder.vue

@@ -1,5 +1,25 @@
 <template>
-	<view>
+	<view class="management">
+		<view class="managelind">
+			<view class="managename" @click="Tenantbill">
+				<view class="managename1">
+					<img :src='src1' alt="">
+				</view>
+				<view class="managename2">
+					租户账单
+				</view>
+			</view>
+			<view class="managename" @click="Remotecontrol">
+				<view class="managename1">
+					<img :src='src2' alt="">
+				</view>
+				<view class="managename2">
+					远程管控
+				</view>
+			</view>
+			
+		</view>
+	
 		
 	</view>
 </template>
@@ -8,15 +28,53 @@
 	export default {
 		data() {
 			return {
-				
+					src1: require('@/static/management/zd.png'),
+					src2: require('@/static/management/yc.png'),
 			}
 		},
 		methods: {
+			Tenantbill(){
+				uni.navigateTo({
+					url: '/pages/Workorder/Tenantbill/Tenantbill'
+				})				
+			},
+			Remotecontrol(){
+				uni.navigateTo({
+					url: '/pages/Workorder/Remotecontrol/Remotecontrol'
+				})
+			},
 			
 		}
 	}
 </script>
 
 <style>
+.management{}
+.managelind{
+	display: flex;
+	justify-content: space-around;
+	align-items: center;
+	width: 690rpx;
+	min-height: 130rpx;
+	margin: 20rpx auto;
+	background: #fff;
+	border-radius: 10px;
+}
+.managename{
+	display: flex;
+	flex-direction: column;
+	align-items: center;
+	justify-content: center;
+}
+.managename1 img{
+		width: 40rpx;
+		height: 40rpx;
+}
+.managename2{
+	padding-top: 15rpx;
+	color: #666;
+	font-size: 20rpx;
+}
+
 
 </style>

BIN
static/management/yc.png


BIN
static/management/zd.png


+ 1 - 1
uni.scss

@@ -29,7 +29,7 @@ $uni-color-warning: #f0ad4e;
 $uni-color-error: #dd524d;
 
 /* 文字基本颜色 */
-$uni-text-color:#333;//基本色
+$uni-text-color:#666;//基本色
 $uni-text-color-inverse:#fff;//反色
 $uni-text-color-grey:#999;//辅助灰色,如加载更多的提示信息
 $uni-text-color-placeholder: #808080;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2 - 2
unpackage/cache/wgt/__UNI__FF40C0C/app-config-service.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 6 - 6
unpackage/cache/wgt/__UNI__FF40C0C/app-service.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
unpackage/cache/wgt/__UNI__FF40C0C/app-view.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
unpackage/cache/wgt/__UNI__FF40C0C/manifest.json


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 2 - 2
unpackage/dist/build/app-plus/app-config-service.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 6 - 6
unpackage/dist/build/app-plus/app-service.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
unpackage/dist/build/app-plus/app-view.js


Filskillnaden har hållts tillbaka eftersom den är för stor
+ 1 - 1
unpackage/dist/build/app-plus/manifest.json


BIN
unpackage/release/apk/__UNI__FF40C0C__20230327163324.apk