zhnghongrui 1 vuosi sitten
vanhempi
commit
136a2870ad

+ 37 - 2
api/common.js

@@ -1,5 +1,40 @@
 import request from '@/utils/request'
 
+// 修改历史
+export function putHistory(param) {
+	return request({
+		'url': '/zdsz/engineeringCivil',
+		'method': 'put',
+		'data': param
+	})
+}
+// 获取历史详情
+export function getHistoryDetails(id, name) {
+
+	return request({
+		'url': '/zdsz/engineeringCivil/' + id + '/' + name,
+		'method': 'get',
+	})
+}
+//  通过身份查询历史 
+export function gethistoryList(enginType, createBy, pageNum, pageSize) {
+	let enginClassification = 'indoor_engin';
+	let enginCycle = '0';
+	const data = {
+		enginType,
+		enginClassification,
+		enginCycle,
+		createBy,
+		pageNum,
+		pageSize
+
+	}
+	return request({
+		'url': '/zdsz/engineeringCivil/list',
+		'method': 'get',
+		'data': data
+	})
+}
 // 新增拆旧管
 export function openBolt(param) {
 	return request({
@@ -232,7 +267,7 @@ export function getEnginSpecificationsList(materId) {
 }
 
 // 工程材质下拉
-export function getEnginMaterialQualityList(enginType, enginSort, enginNode, enginStep,nameType) {
+export function getEnginMaterialQualityList(enginType, enginSort, enginNode, enginStep, nameType) {
 	const data = {
 		enginType
 	}
@@ -241,7 +276,7 @@ export function getEnginMaterialQualityList(enginType, enginSort, enginNode, eng
 		data['enginNode'] = enginNode
 		data['enginStep'] = enginStep
 	}
-	if(nameType !== undefined ){
+	if (nameType !== undefined) {
 		data['nameType'] = nameType
 	}
 	return request({

+ 2 - 2
config.js

@@ -2,8 +2,8 @@
 module.exports = {
 	 // baseUrl: 'https://www.xcx.cczdsz.cn/prod-api',
 	// baseUrl: 'http://192.168.4.6:8080',
-	// baseUrl: 'http://192.168.4.20:8080',
-	baseUrl: 'http://192.168.4.11:8080',
+	 baseUrl: 'http://192.168.4.23:8080',
+	//baseUrl: 'http://192.168.4.11:8080',
 	// baseUrl: 'http://192.168.4.23:8080',
 	// baseUrl: 'http://192.168.4.14:8089',
 	baseIconUrl: 'https://www.xcx.cczdsz.cn/app/images/',

+ 7 - 0
pages.json

@@ -101,6 +101,13 @@
 			}
 		},
 		{
+			"path": "pages/statistics/historyDetails",
+			"style": {
+				"navigationBarTitleText": "历史详情"
+
+			}
+		},
+		{
 			"path": "pages/bottom_leg/bottom_leg",
 			"style": {
 				"navigationBarTitleText": "底腿"

+ 757 - 0
pages/statistics/historyDetails.vue

@@ -0,0 +1,757 @@
+<template>
+	<view>
+		<view class="uni-media-list">
+
+			<view class="uni-media-list-body" style="margin-left: 15px;">
+				<view v-for="(value, key) in dataJson.zEngineeringNodeBo.zEngineeringInfoBoList" :key="key"
+					v-if="isEdit(value)">
+					<view class=" uni-media-list-text-top">
+						<view class="tit-text">施工时间:</view>{{value.updateTime}}
+					</view>
+
+					<view class="uni-media-list-text-top" v-if="title=='拆旧管'">
+						<view class="tit-text">腐蚀等级:</view>
+						<view @click="pickerShow('fsdj',key)">
+							{{getSelectName(value.zEngineeringMaterialBo[0].corrosionLevel)}}
+						</view>
+					</view>
+					<view class="uni-media-list-text-top" v-if="title=='打孔'">
+						<view class="tit-text">孔距:</view>
+						<view @click="pickerShow('kj',key)">
+							<!-- 123 -->
+							{{getSelectName(value.zEngineeringMaterialBo[0].corrosionLevel)}}
+						</view>
+					</view>
+					<view class="uni-media-list-text-top" v-if="title=='挂表'">
+						<view class="tit-text">品牌:</view>
+						<view @click="pickerShow('brand',key)">
+							{{getSelectName(value.zEngineeringMaterialBo[0].brand)}}
+						</view>
+					</view>
+					<view class="uni-media-list-text-top" v-if="title=='切断阀'||title=='报警器'">
+						<view class="tit-text">厂家:</view>
+						<view @click="pickerShow('brand',key)">
+							{{getSelectName(value.zEngineeringMaterialBo[0].brand)}}
+						</view>
+					</view>
+					<view class="uni-media-list-text-top" v-if="title=='立杠'||title=='表后管'">
+						<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+
+							<view>
+								材 质
+							</view>
+
+							<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz',key)">
+								<span
+									style="color: black;">{{value.zEngineeringMaterialBo[0].materialQualityName}}</span>
+								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							</view>
+						</view>
+						<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+
+							<view>
+								规 格
+							</view>
+
+							<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gg',key)">
+								<span
+									style="color: black;">{{value.zEngineeringMaterialBo[0].specificationsName==''?'请选择规格':value.zEngineeringMaterialBo[0].specificationsName}}</span>
+								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							</view>
+						</view>
+						<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+							<text>米 数</text>
+							<view style="display: flex; justify-content: right; width: 70%;">
+								<input class="uni-input" type="number"
+									:value="getIntegerPart(value.zEngineeringMaterialBo[0].number,0)"
+									@change="setInfoBoNumber(key,$event.target.value,0)" maxlength="6"
+									style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
+								<text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
+
+								<input class="uni-input" type="number"
+									:value="getIntegerPart(value.zEngineeringMaterialBo[0].number,1)"
+									@change="setInfoBoNumber(key,$event.target.value,1)" maxlength="1"
+									style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
+							</view>
+						</view>
+					</view>
+
+					<view class="uni-list" style="margin-bottom: 20px;" v-if="title=='阀管'">
+
+						<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+
+							<view>
+								上门类型
+							</view>
+
+							<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('door',key)">
+								<span style="color: black;">{{value.zEngineeringMaterialBo[0].visitType}}</span>
+								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							</view>
+						</view>
+						<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+
+							<view>
+								自闭阀厂家
+							</view>
+
+							<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('zbf',key)">
+								<span
+									style="color: black;">{{getSelectZBFName(value.zEngineeringMaterialBo[0].selfClosingValveType)}}</span>
+								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							</view>
+						</view>
+						<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+
+							<view>
+								灶具管厂家
+							</view>
+
+							<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('cz',key)">
+								<span
+									style="color: black;">{{value.zEngineeringMaterialBo[0].materialQualityName}}</span>
+								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							</view>
+						</view>
+						<view class="container" style="border-bottom: 1px solid #f8f8f8;">
+
+							<view>
+								规 格
+							</view>
+
+							<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('gg',key)">
+								<span
+									style="color: black;">{{value.zEngineeringMaterialBo[0].specificationsName==''?'请选择规格':value.zEngineeringMaterialBo[0].specificationsName}}</span>
+								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							</view>
+						</view>
+					</view>
+
+					<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
+						<image :src="loadImgSrc('updateimg.png')" mode=""
+							style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose(key)">
+						</image>
+						<view v-for="(item,index) in  value.zEngiineeringPhotoBoList" :key="index"
+							style="position: relative;">
+							<view
+								v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
+								<image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
+									@click="showPhoto(index,value.zEngiineeringPhotoBoList)">
+								</image>
+							</view>
+							<view v-else>
+								<video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
+							</view>
+							<view @click="remove(index,key)"
+								style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
+								<image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
+								</image>
+							</view>
+						</view>
+					</view>
+					<!-- </view> -->
+				</view>
+			</view>
+		</view>
+		<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
+			subtitleKey="id">
+		</SelectPicker>
+		<SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
+			titleKey="dictLabel" subtitleKey="dictValue" v-model="name"></SelectPicker>
+		<view class="action-btn" v-if="hideButton==false">
+			<button @click="submit" class="btn cu-btn block bg-blue lg round">确认</button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import SelectPicker from '../../components/selectPicker/select_picker.vue'
+	import {
+		getDicts
+	} from "@/api/system/dict/data";
+	import {
+		getToken
+	} from '../../utils/auth';
+	import user from '@/store/modules/user'
+	import {
+		getHistoryDetails,
+		getEnginMaterialQualityList,
+		putHistory,
+		getEnginSpecificationsList
+	} from '@/api/common'
+	export default {
+		components: {
+			SelectPicker,
+		},
+		data() {
+			return {
+				selectZbfList: [],
+				dictOptions: [],
+				openDict: false,
+				dataIndex: 0, //数据用第几条
+				imageIndex: 0,
+				headers: {
+					Authorization: "Bearer " + getToken()
+				},
+				nodeId: '',
+				type: '',
+				title: '',
+				dataJson: '',
+				enginClassification: '',
+				enginType: '',
+				enginClassValue: '',
+				selectList: [],
+				open: false,
+				chooseType: '',
+				hideButton: false,
+			}
+		},
+		onLoad(options) {
+			if ('params' in options) {
+				let e = JSON.parse(decodeURIComponent(options.params));
+				this.nodeId = e.id;
+				this.type = e.type;
+				getHistoryDetails(this.nodeId, this.type).then(response => {
+					if (response.data.zEngineeringNodeBo != null) {
+						this.hideButton = false;
+						this.dataJson = response.data;
+						this.title = response.data.zEngineeringNodeBo.type;
+						this.enginType = response.data.enginType;
+						this.enginClassification = response.data.enginClassification;
+						if (this.type == '阀管') {
+							getEnginMaterialQualityList("民用工程", this.enginType, this.enginClassification, this
+									.title,
+									'自闭阀厂家')
+								.then(
+									response => {
+										this.selectZbfList = response.data;
+										this.selectList = this.selectZbfList;
+									});
+						} else {
+
+							this.getFSDJLevel();
+						}
+					} else {
+						this.hideButton = true;
+						this.$modal.msg("暂无历史信息")
+					}
+				});
+
+			}
+		},
+		methods: {
+			//关闭弹窗
+			closeDict(e) {
+				this.openDict = false
+			},
+			remove(index, key) {
+				uni.showModal({
+					title: '提示',
+					content: '是否删除该图片或视频?',
+					success: (res) => {
+						if (res.confirm) {
+
+							this.dataJson.zEngineeringNodeBo
+								.zEngineeringInfoBoList[key]
+								.zEngiineeringPhotoBoList.splice(index, 1)
+
+						}
+					}
+				})
+			},
+			choose(index1, index) {
+				this.dataIndex = index1;
+				let _this = this;
+				uni.showActionSheet({
+					title: '上传',
+					itemList: ['图片', '视频'],
+					success: (res) => {
+						if (res.tapIndex == 0) {
+							this.chooseimage()
+						} else {
+							this.choosevideo()
+						}
+					}
+				})
+			},
+			chooseimage() {
+
+				let _this = this;
+				uni.chooseImage({
+					sizeType: ['album', 'camera'],
+					success(resp) {
+						resp.tempFiles.forEach((item, index) => {
+							const task = uni.uploadFile({
+								url: _this.$HTTP + `/obs`,
+								filePath: item.path,
+								name: 'file',
+								formData: {},
+								header: _this.headers,
+
+								success: res => {
+									// 判断是否json字符串,将其转为json格式
+									// let data = _this.$u.test.jsonString(res
+									// 	.data) ? JSON.parse(res.data) : res.data;
+									let data = JSON.parse(res.data);
+									if (![200].includes(data.code)) {
+										// this.uploadError(index, data);
+										_this.$modal.msg(data.msg)
+									} else {
+										if (_this.progress === 100) {
+
+											// _this.imgArr.push(data.data.url)
+											_this.dataJson.zEngineeringNodeBo
+												.zEngineeringInfoBoList[_this.dataIndex]
+												.zEngiineeringPhotoBoList.push(data.data.url);
+											_this.$modal.msg('上传成功!')
+											_this.photo = false;
+										}
+									}
+								},
+								fail: e => {
+									_this.$modal.msg('上传失败!')
+									//_this.uploadError(index, e);
+								},
+								complete: res => {
+									uni.hideLoading();
+									_this.uploading = false;
+
+								}
+							});
+							task.onProgressUpdate(res => {
+								_this.progress = res.progress;
+								uni.showLoading({
+									title: '上传中'
+								})
+								if (_this.progress != 100) {
+									_this.loading = false
+								} else {
+									_this.loading = true
+								}
+							});
+
+						})
+
+					},
+				})
+			},
+
+			choosevideo() {
+				let _this = this;
+				uni.chooseVideo({
+					sourceType: ['album', 'camera'],
+					maxDuration: 30,
+					success(resp) {
+						const task = uni.uploadFile({
+							url: _this.$HTTP + `/obs`,
+							filePath: resp.tempFilePath,
+							name: 'file',
+							formData: {},
+							header: _this.headers,
+							success: res => {
+								// 判断是否json字符串,将其转为json格式
+								let data = JSON.parse(res.data);
+								if (![200].includes(res.statusCode)) {
+									this.uploadError(index, data);
+								} else {
+									//上传成功
+									if (_this.progress === 100) {
+										//_this.imgArr.push(data.data.url)
+										_this.dataJson.zEngineeringNodeBo
+											.zEngineeringInfoBoList[_this.dataIndex]
+											.zEngiineeringPhotoBoList.push(data.data.url);
+										_this.$modal.msg('上传成功!')
+										_this.photo = false;
+									}
+								}
+							},
+							fail: e => {
+								_this.$modal.msg('上传失败!')
+								this.uploadError(index, e);
+							},
+							complete: res => {
+								uni.hideLoading();
+								_this.uploading = false;
+							}
+						});
+						task.onProgressUpdate(res => {
+							_this.progress = res.progress;
+							uni.showLoading({
+								title: '上传中'
+							})
+							if (_this.progress != 100) {
+								_this.loading = false
+							} else {
+								_this.loading = true
+							}
+						});
+
+					},
+				})
+			},
+			showPhoto(index, arr) {
+				uni.previewImage({
+					current: index,
+					urls: arr,
+				})
+
+			},
+			//关闭弹窗
+			close(e) {
+				this.open = false
+			},
+
+			// 截取小数点前的字符串
+			getIntegerPart(numStr, i) {
+				return numStr.toString().split('.')[i];
+			},
+			setInfoBoNumber(key, number, i) {
+				let Ynumber = this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].zEngineeringMaterialBo[0]
+					.number;
+				let resAry = Ynumber.toString().split('.');
+				resAry[i] = number
+				this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].zEngineeringMaterialBo[0].number = resAry
+					.join('.');
+			},
+			changeSelectDict(item, index) {
+				this.openDict = false;
+				if (this.chooseType == 'door') {
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.visitType = item.dictValue;
+
+				}
+			},
+			pickerShow(e, index) {
+				this.dataIndex = index;
+				this.chooseType = e;
+
+
+				if (e == 'door') {
+					this.openDict = true;
+					getDicts("visit_type").then(response => {
+						this.dictOptions = response.data;
+					});
+				}
+				if (e == 'brand') {
+					this.open = true;
+					this.getFSDJLevel();
+				}
+				if (e == 'kj') {
+					this.open = true;
+					this.getFSDJLevel();
+				}
+				if (e == 'zbf') {
+					this.open = true;
+					//this.getFSDJLevel();
+					getEnginMaterialQualityList("民用工程", this.enginType, this.enginClassification, this.title, '自闭阀厂家')
+						.then(
+							response => {
+								this.selectZbfList = response.data;
+								this.selectList = this.selectZbfList;
+							});
+				}
+				if (e == 'fsdj') {
+					this.open = true;
+					this.getFSDJLevel();
+				}
+				if (e == 'cz') {
+					this.open = true;
+
+					if (this.type == '阀管') {
+						getEnginMaterialQualityList("民用工程", this.enginType, this.enginClassification, this.title, "灶具管厂家")
+							.then(response => {
+								this.selectList = response.data;
+							});
+					} else {
+						this.getFSDJLevel();
+					}
+
+
+
+				}
+				if (e == 'gg') {
+					this.open = true;
+					//根据材质ID 获取规格数据
+					getEnginSpecificationsList(this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex]
+						.zEngineeringMaterialBo[0]
+						.materialQuality).then(res => {
+						this.selectList = res.data
+					})
+				}
+
+
+			},
+			isEmpty(str) {
+
+				return (!str || 0 === str.length);
+
+			},
+			changeSelect(item, index) {
+				this.open = false;
+				if (this.chooseType == 'fsdj' || this.chooseType == 'kj') {
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.corrosionLevel = item.id;
+				} else if (this.chooseType == 'cz') {
+					console.log("ddd")
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.materialQuality = item.id;
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.materialQualityName = item.name;
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.specifications = '';
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.specificationsName = '';
+
+
+				} else if (this.chooseType == 'gg') {
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.specifications = item.id;
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.specificationsName = item.name;
+				} else if (this.chooseType == 'brand') {
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.brand = item.id;
+
+				} else if (this.chooseType == 'zbf') {
+					this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[0]
+						.selfClosingValveType = item.id;
+
+				}
+			},
+			getFSDJLevel() {
+				getEnginMaterialQualityList("民用工程", this.enginType, this.enginClassification, this.title).then(
+					response => {
+						this.selectList = response.data;
+						this.$forceUpdate();
+
+					});
+			},
+			getSelectName(id) {
+				let res = '';
+				this.selectList.forEach((val) => {
+					if (id == val.id) {
+
+						res = val.name
+					};
+				})
+				return res;
+			},
+			getSelectZBFName(id) {
+				let res = '';
+				this.selectZbfList.forEach((val) => {
+					if (id == val.id) {
+						res = val.name
+					};
+				})
+				return res;
+			},
+			isEdit(item) {
+				var isShow = item.createBy == this.$user.state.name;
+
+				return isShow;
+			},
+			submit() {
+				let isSubmit = true;
+				this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList.forEach((res) => {
+					if(res.zEngiineeringPhotoBoList.length == 0){
+						this.$modal.msg("请上传照片");
+						isSubmit = false;
+					}
+					if(this.title == '立杠'||this.title == '表后管'||this.title == '阀管'){
+						if(res.zEngineeringMaterialBo[0].specifications == ''){
+							this.$modal.msg("请选择规格");
+							isSubmit = false;
+						}
+					}
+					if(this.title == '立杠'||this.title == '表后管'){
+						if(res.zEngineeringMaterialBo[0].number == ''){
+							this.$modal.msg("请输入米数");
+							isSubmit = false;
+						}
+					}
+				})
+				if(!isSubmit){return}
+
+				putHistory(this.dataJson).then(
+
+					response => {
+						if (response.code == '200') {
+							uni.hideLoading()
+							uni.showToast({
+								title: response.msg,
+								icon: 'none',
+								duration: 2000
+							});
+							setTimeout(function() {
+								uni.navigateBack();
+							}, 1000)
+
+						}
+
+					});
+			}
+		}
+
+	}
+</script>
+
+<style lang="scss">
+	.uni-media-list-body {
+		border: 1px solid #eee;
+		border-radius: 40rpx;
+		margin: 10rpx 30rpx 20rpx;
+		padding: 10rpx 0 40rpx;
+		box-shadow: 0 0 5px #eee;
+	}
+
+	.container {
+		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		padding: 10px;
+		position: relative;
+
+	}
+
+	.to-right-icon {
+		width: 15px;
+		height: 15px;
+		position: absolute;
+		top: 50%;
+		transform: translateY(-50%);
+	}
+
+	.share {
+		width: 100%;
+		height: 100%;
+
+	}
+
+	.tit-text {
+		color: #4f535a;
+		margin-right: 20rpx;
+	}
+
+	.normal-text {}
+
+	.cz-style {
+		background: #e8f4f9;
+		margin: 20rpx;
+		padding: 10rpx;
+		border-radius: 20rpx;
+		border: 1px solid #d4e3f0;
+	}
+
+	.uni-media-list-text-top {
+		font-size: 14px;
+		color: #696969;
+		padding: 20rpx 20rpx;
+		border-bottom: 1px solid #eee;
+		display: flex;
+		align-items: center;
+	}
+
+	.share-box {
+		width: 100%;
+		height: 100%;
+		position: fixed;
+		top: 0rpx;
+		left: 0rpx;
+		bottom: 0rpx;
+		right: 0rpx;
+		background-color: rgba(0, 0, 0, 0.4);
+		transition: .3s;
+		z-index: 999;
+	}
+
+	// 进入分享动画
+	.share-show {
+		transition: all 0.3s ease;
+		transform: translateY(0%) !important;
+		border-radius: 20px 20px 0px 0px;
+	}
+
+	.scroll-Y {
+		height: 58vh;
+	}
+
+	// 离开分享动画
+	.share-item {
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		height: 70%;
+		background-color: #FFFFFF;
+		transition: all 0.3s ease;
+		transform: translateY(100%);
+		z-index: 1999;
+
+		.share-to {
+			width: 100%;
+			height: 30px;
+			display: flex;
+			justify-content: left;
+			margin: 30rpx 35rpx;
+			align-items: center;
+
+			// &::after {
+			// 	content: '';
+			// 	width: 240rpx;
+			// 	height: 0rpx;
+			// 	border-top: 1px solid #E4E7ED;
+			// 	-webkit-transform: scaleY(0.5);
+			// 	transform: scaleY(0.5);
+			// 	margin-left: 30rpx;
+			// }
+
+			// &::before {
+			// 	content: '';
+			// 	width: 240rpx;
+			// 	height: 0rpx;
+			// 	border-top: 1px solid #E4E7ED;
+			// 	-webkit-transform: scaleY(0.5);
+			// 	transform: scaleY(0.5);
+			// 	margin-right: 30rpx;
+			// }
+		}
+
+		.content {
+			width: 100%;
+			height: auto;
+			display: flex;
+			flex-wrap: wrap;
+
+			.block {
+				width: 100%;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: left;
+				height: auto;
+
+				image {
+					width: 80rpx;
+					height: 80rpx;
+				}
+
+				text {
+					margin-top: 16rpx;
+					font-size: 28rpx;
+					color: #606266;
+				}
+			}
+		}
+
+		.cancel {
+			width: 100%;
+			height: 3rem;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			border-top: 1rpx solid #E4E7ED;
+		}
+
+
+	}
+</style>

+ 372 - 180
pages/statistics/statistics.vue

@@ -1,225 +1,230 @@
 <template>
 	<view>
-	<view v-if="isLeader==false">
-		<scroll-view>
-			<view class="view-bg">
-				<text class="title-txt">工程用料统计</text>
-				<view>
-					<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
-						<view class="uni-list-cell-left">
-							行政区
-						</view>
-						<view class="uni-list-cell-db">
-							<view v-if="this.isEmpty(this.XZQValue.dictValue)" style="margin-top: 10;"
-								@click="pickerShow('xzq')">
-								<span style="color: darkgray;">请选择行政区</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+		<view v-if="isLeader=='sys_user'">
+			<scroll-view>
+				<view class="view-bg">
+					<text class="title-txt">工程用料统计</text>
+					<view>
+						<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
+							<view class="uni-list-cell-left">
+								行政区
 							</view>
-							<view v-else style="margin-top: 10;" @click="pickerShow('xzq')">
-								<span style="color: black;">{{XZQValue.dictLabel}}</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							<view class="uni-list-cell-db">
+								<view v-if="this.isEmpty(this.XZQValue.dictValue)" style="margin-top: 10;"
+									@click="pickerShow('xzq')">
+									<span style="color: darkgray;">请选择行政区</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
+								<view v-else style="margin-top: 10;" @click="pickerShow('xzq')">
+									<span style="color: black;">{{XZQValue.dictLabel}}</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
 							</view>
-						</view>
 
 
-					</view>
-					<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
-						<view class="uni-list-cell-left">
-							小区
 						</view>
-						<view class="uni-list-cell-db">
-							<view v-if="this.isEmpty(this.XQValue.id)" style="margin-top: 10;"
-								@click="pickerShow('xq')">
-								<span style="color: darkgray;">请选择小区</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+						<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
+							<view class="uni-list-cell-left">
+								小区
 							</view>
-							<view v-else style="margin-top: 10;" @click="pickerShow('xq')">
-								<span style="color: black;">{{XQValue.name}}</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							<view class="uni-list-cell-db">
+								<view v-if="this.isEmpty(this.XQValue.id)" style="margin-top: 10;"
+									@click="pickerShow('xq')">
+									<span style="color: darkgray;">请选择小区</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
+								<view v-else style="margin-top: 10;" @click="pickerShow('xq')">
+									<span style="color: black;">{{XQValue.name}}</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
 							</view>
 						</view>
-					</view>
-					<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
-						<view class="uni-list-cell-left">
-							材料
-						</view>
-						<view class="uni-list-cell-db">
-							<view v-if="this.isEmpty(this.materialValue.name)" style="margin-top: 10;"
-								@click="pickerShow('cz')">
-								<span style="color: darkgray;">请选择材料</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+						<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
+							<view class="uni-list-cell-left">
+								材料
 							</view>
-							<view v-else style="display: flex;align-items: center; justify-content: flex-end;">
-								<view style="margin-top: 10; " @click="pickerShow('cz')">
-									<span style="color: black;">{{materialValue.name}}</span>
-									<!-- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image> -->
+							<view class="uni-list-cell-db">
+								<view v-if="this.isEmpty(this.materialValue.name)" style="margin-top: 10;"
+									@click="pickerShow('cz')">
+									<span style="color: darkgray;">请选择材料</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
+								<view v-else style="display: flex;align-items: center; justify-content: flex-end;">
+									<view style="margin-top: 10; " @click="pickerShow('cz')">
+										<span style="color: black;">{{materialValue.name}}</span>
+										<!-- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image> -->
+									</view>
+									<uni-icons type="clear" size="24" color="#999"
+										style="margin-left:20rpx ;margin-right: -20rpx;"
+										@click="clearMaterialInfo"></uni-icons>
 								</view>
-								<uni-icons type="clear" size="24" color="#999"
-									style="margin-left:20rpx ;margin-right: -20rpx;"
-									@click="clearMaterialInfo"></uni-icons>
 							</view>
 						</view>
-					</view>
-					<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
-						<view class="uni-list-cell-left">
-							规格
-						</view>
-						<view class="uni-list-cell-db">
-							<view v-if="this.isEmpty(this.specificationValue.name)" style="margin-top: 10;"
-								@click="pickerShow('gg')">
-								<span style="color: darkgray;">请选择规格</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+						<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
+							<view class="uni-list-cell-left">
+								规格
 							</view>
-							<view v-else style="display: flex;align-items: center; justify-content: flex-end;">
-								<view style="margin-top: 10;" @click="pickerShow('gg')">
-									<span style="color: black;">{{specificationValue.name}}</span>
-									<!-- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image> -->
+							<view class="uni-list-cell-db">
+								<view v-if="this.isEmpty(this.specificationValue.name)" style="margin-top: 10;"
+									@click="pickerShow('gg')">
+									<span style="color: darkgray;">请选择规格</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
+								<view v-else style="display: flex;align-items: center; justify-content: flex-end;">
+									<view style="margin-top: 10;" @click="pickerShow('gg')">
+										<span style="color: black;">{{specificationValue.name}}</span>
+										<!-- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image> -->
+									</view>
+									<uni-icons type="clear" size="24" color="#999"
+										style="margin-left:20rpx ;margin-right: -20rpx;"
+										@click="clearSpecificationInfo"></uni-icons>
 								</view>
-								<uni-icons type="clear" size="24" color="#999"
-									style="margin-left:20rpx ;margin-right: -20rpx;"
-									@click="clearSpecificationInfo"></uni-icons>
 							</view>
 						</view>
-					</view>
 
-				</view>
+					</view>
 
 
-				<view class="table">
-					<view class="felx-row">
-						<view class="h-tr" style="flex: 1">名称</view>
-						<view class="h-tr" style="flex: 1;align-items: center;">预计用量</view>
-						<view class="h-tr" style="flex: 1">实际用量</view>
+					<view class="table">
+						<view class="felx-row">
+							<view class="h-tr" style="flex: 1">名称</view>
+							<view class="h-tr" style="flex: 1;align-items: center;">预计用量</view>
+							<view class="h-tr" style="flex: 1">实际用量</view>
+						</view>
+					</view>
+					<view class="felx-row" v-for="(item, index) in materialUsageList" :key="index">
+						<view class="h-td" style="flex: 1">{{ item.materialQuality }}</view>
+						<view class="h-td" style="flex: 1">{{ item.estimatedSize }}</view>
+						<view class="h-td" style="flex: 1">{{ item.realitySize }}</view>
 					</view>
-				</view>
-				<view class="felx-row" v-for="(item, index) in materialUsageList" :key="index">
-					<view class="h-td" style="flex: 1">{{ item.materialQuality }}</view>
-					<view class="h-td" style="flex: 1">{{ item.estimatedSize }}</view>
-					<view class="h-td" style="flex: 1">{{ item.realitySize }}</view>
-				</view>
 
 
-			</view>
+				</view>
 
-			<view class="view-bg" style="margin-bottom: 40rpx;">
-				<text class="title-txt">工程进度统计</text>
-				<view>
-					<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
-						<view class="uni-list-cell-left">
-							行政区
-						</view>
-						<view class="uni-list-cell-db">
-							<view v-if="this.isEmpty(this.XZQValue2.dictValue)" style="margin-top: 10;"
-								@click="pickerShow('xzq2')">
-								<span style="color: darkgray;">请选择行政区</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+				<view class="view-bg" style="margin-bottom: 40rpx;">
+					<text class="title-txt">工程进度统计</text>
+					<view>
+						<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
+							<view class="uni-list-cell-left">
+								行政区
 							</view>
-							<view v-else style="margin-top: 10;" @click="pickerShow('xzq2')">
-								<span style="color: black;">{{XZQValue2.dictLabel}}</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+							<view class="uni-list-cell-db">
+								<view v-if="this.isEmpty(this.XZQValue2.dictValue)" style="margin-top: 10;"
+									@click="pickerShow('xzq2')">
+									<span style="color: darkgray;">请选择行政区</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
+								<view v-else style="margin-top: 10;" @click="pickerShow('xzq2')">
+									<span style="color: black;">{{XZQValue2.dictLabel}}</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
 							</view>
-						</view>
 
 
-					</view>
-					<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
-						<view class="uni-list-cell-left"> 小区</view>
-						<view class="uni-list-cell-db">
-							<view v-if="this.isEmpty(this.XQValue2.id)" style="margin-top: 10;"
-								@click="pickerShow('xq2')">
-								<span style="color: darkgray;">请选择小区</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
-							</view>
-							<view v-else style="margin-top: 10;" @click="pickerShow('xq2')">
-								<span style="color: black;">{{XQValue2.name}}</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
-							</view>
 						</view>
-
-					</view>
-					<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
-						<view class="uni-list-cell-left">楼栋</view>
-						<view class="uni-list-cell-db">
-							<view v-if="this.isEmpty(this.LDValue2.id)" style="margin-top: 10;"
-								@click="pickerShow('ld2')">
-								<span style="color: darkgray;">请选择楼栋</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
-							</view>
-							<view style="margin-top: 10;" @click="pickerShow('ld2')">
-								<span style="color: black;">{{LDValue2.name}}</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+						<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
+							<view class="uni-list-cell-left"> 小区</view>
+							<view class="uni-list-cell-db">
+								<view v-if="this.isEmpty(this.XQValue2.id)" style="margin-top: 10;"
+									@click="pickerShow('xq2')">
+									<span style="color: darkgray;">请选择小区</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
+								<view v-else style="margin-top: 10;" @click="pickerShow('xq2')">
+									<span style="color: black;">{{XQValue2.name}}</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
 							</view>
-						</view>
 
-					</view>
-					<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
-						<view class="uni-list-cell-left">单元</view>
-						<view class="uni-list-cell-db">
-							<view v-if="this.isEmpty(this.DYValue2.id)" style="margin-top: 10;"
-								@click="pickerShow('dy2')">
-								<span style="color: darkgray;">请选择单元</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+						</view>
+						<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
+							<view class="uni-list-cell-left">楼栋</view>
+							<view class="uni-list-cell-db">
+								<view v-if="this.isEmpty(this.LDValue2.id)" style="margin-top: 10;"
+									@click="pickerShow('ld2')">
+									<span style="color: darkgray;">请选择楼栋</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
+								<view style="margin-top: 10;" @click="pickerShow('ld2')">
+									<span style="color: black;">{{LDValue2.name}}</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
 							</view>
-							<view v-else style="margin-top: 10;" @click="pickerShow('dy2')">
-								<span style="color: black;">{{DYValue2.name}}</span>
-								<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+
+						</view>
+						<view class="uni-list-cell" style="border-bottom: 1px solid #f8f8f8;">
+							<view class="uni-list-cell-left">单元</view>
+							<view class="uni-list-cell-db">
+								<view v-if="this.isEmpty(this.DYValue2.id)" style="margin-top: 10;"
+									@click="pickerShow('dy2')">
+									<span style="color: darkgray;">请选择单元</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
+								<view v-else style="margin-top: 10;" @click="pickerShow('dy2')">
+									<span style="color: black;">{{DYValue2.name}}</span>
+									<image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
+								</view>
 							</view>
+
 						</view>
 
 					</view>
-
-				</view>
-				<image :src="loadImgSrc('lou-img-bg.png')" style="width: 110%;
+					<image :src="loadImgSrc('lou-img-bg.png')" style="width: 110%;
     height: 121px;
     position: absolute;
     bottom: 15px;
     left: -5px;
     z-index: 1;
 "></image>
-				<scroll-view :scroll-x="true" class="view_bg_build" v-if="roomList.length > 0">
-					<view class="HuaDongBiao">
-						<view class="NeiRong" v-for="(item,index) in roomList" :key="index">
-							<view class="Fang" v-for="(item2, index2) in roomList[index]" :key="index2">
-								<view v-if="item2.roomStatus=='施工中'" class="ShiGongZhong">{{ item2.roomName }}</view>
-								<view v-else-if="item2.roomStatus=='未施工'" class="WeiShiGong">{{ item2.roomName }}</view>
-								<view v-else class="JunGong">{{ item2.roomName }}</view>
+					<scroll-view :scroll-x="true" class="view_bg_build" v-if="roomList.length > 0">
+						<view class="HuaDongBiao">
+							<view class="NeiRong" v-for="(item,index) in roomList" :key="index">
+								<view class="Fang" v-for="(item2, index2) in roomList[index]" :key="index2">
+									<view v-if="item2.roomStatus=='施工中'" class="ShiGongZhong">{{ item2.roomName }}
+									</view>
+									<view v-else-if="item2.roomStatus=='未施工'" class="WeiShiGong">{{ item2.roomName }}
+									</view>
+									<view v-else class="JunGong">{{ item2.roomName }}</view>
+								</view>
 							</view>
 						</view>
-					</view>
-					<view
-						style="width: 48rpx;height: 63rpx;background: #C7EAFF; position:relative; left: 50%; transform: translateX(-50%); bottom: -10rpx;">
-					</view>
+						<view
+							style="width: 48rpx;height: 63rpx;background: #C7EAFF; position:relative; left: 50%; transform: translateX(-50%); bottom: -10rpx;">
+						</view>
 
-				</scroll-view>
-				<view v-if="roomList.length == 0" style="padding:50rpx;text-align: center;">暂无数据</view>
-				<view style="align-items: center; margin-top: 20rpx;">
-					<view style="display: flex;align-items: center;justify-content:center">
-						<image class="block-iv" :src="loadImgSrc('ic_legend.png')"></image>
-						<text style="margin-right: 20px;margin-left: 5px;">图例: </text>
-						<div class="block-iv" style="background-color: #80d9ae;"></div>
-						<text style="margin-right: 20px;margin-left: 5px;">竣工</text>
-						<div class="block-iv" style="background-color: #5bd3ff;"></div>
-						<text style="margin-right: 20px;margin-left: 5px;">施工中</text>
-						<div class="block-iv" style="background-color: #ffc881;"></div>
-						<text style="margin-right: 20px;margin-left: 5px;">未施工</text>
-					</view>
+					</scroll-view>
+					<view v-if="roomList.length == 0" style="padding:50rpx;text-align: center;">暂无数据</view>
+					<view style="align-items: center; margin-top: 20rpx;">
+						<view style="display: flex;align-items: center;justify-content:center">
+							<image class="block-iv" :src="loadImgSrc('ic_legend.png')"></image>
+							<text style="margin-right: 20px;margin-left: 5px;">图例: </text>
+							<div class="block-iv" style="background-color: #80d9ae;"></div>
+							<text style="margin-right: 20px;margin-left: 5px;">竣工</text>
+							<div class="block-iv" style="background-color: #5bd3ff;"></div>
+							<text style="margin-right: 20px;margin-left: 5px;">施工中</text>
+							<div class="block-iv" style="background-color: #ffc881;"></div>
+							<text style="margin-right: 20px;margin-left: 5px;">未施工</text>
+						</view>
 
+					</view>
 				</view>
-			</view>
 
-			<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
-				subtitleKey="id" v-model="name"></SelectPicker>
+				<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
+					subtitleKey="id" v-model="name"></SelectPicker>
 
-			<SelectPicker :list="dictOptions" @change="changeSelect" v-if="openDict" @close="closeDict"
-				titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
-		</scroll-view>
-	</view>
-	<view v-else-if="isLeader">
+				<SelectPicker :list="dictOptions" @change="changeSelect" v-if="openDict" @close="closeDict"
+					titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
+			</scroll-view>
+		</view>
+		<view v-else-if="isLeader=='app_user'">
+
+
+			<lgd-tab v-model="tabIndex" :tabValue="tabValue" @change="changeTab" />
 			<cc-pullScroolView class="pullScrollView" ref="pullScroll" :pullDown="pullDown" :isDownLoading="true">
 				<view class="notice" v-for="(item,index) in list" :key="index">
-					<view class="justify-content" @click="goDetails(item)">
+					<view class="justify-content" @click="chooseNode(item)">
 						<view class="font-forty">
-							{{item.noticeTitle}}
+							{{item.areaName+item.buildingName+item.unitName+item.houseName}}
 						</view>
 						<view class="font-twenty-eight gray">
 							{{item.createTime}}
@@ -230,7 +235,29 @@
 				</view>
 			</cc-pullScroolView>
 
-	</view>
+
+			<view class="share">
+				<view :class="{'share-box': shareState}" @click="handleHiddenShare">
+				</view>
+				<view class="share-item" :class="{'share-show': shareState}">
+					<view class="share-to">
+						<text>请选择</text>
+					</view>
+					<scroll-view scroll-y="true" class="scroll-Y">
+						<view class="content">
+							<view class="block" v-for="(item, index) in typeList" :key="index"
+								@click="showTypeSheet(item)">
+								<!-- <image :src="item.image" mode="aspectFill"></image> -->
+								<text>{{item.Type}}</text>
+							</view>
+						</view>
+					</scroll-view>
+					<view class="cancel" @click.stop="handleHiddenShare">
+						<text>取消</text>
+					</view>
+				</view>
+			</view>
+		</view>
 	</view>
 </template>
 
@@ -238,11 +265,16 @@
 	import SelectPicker from '../../components/selectPicker/select_picker.vue'
 	import CCBProjectList from '../../uni_modules/cc-pullScroolView/components/cc-pullScroolView/cc-pullScroolView.vue';
 	import {
-		getNoticeList,
+		gethistoryList,
 	} from '@/api/common'
+
+	import {
+		getUserType
+	} from '@/utils/auth';
 	import {
 		getDicts
 	} from "@/api/system/dict/data";
+	import user from '@/store/modules/user'
 	import {
 		getAreaList,
 		getBuildingList,
@@ -262,11 +294,15 @@
 		},
 		data() {
 			return {
-				isLeader: false,
+				tabValue: ['旧改', '新建'],
+				tabIndex: 0,
+				isLeader: '',
 				list: [],
+				newlist: [],
 				pageSize: 10, // 条数
 				totalNum: '',
 				pageNum: 1, // 页数
+				typeList: '', //二次弹窗数据
 				villageIndex: 0,
 				specificationIndex: 0,
 				materialIndex: 0,
@@ -291,6 +327,7 @@
 				projectValue2: {
 					'dictValue': '0'
 				},
+				shareState: false,
 				XZQValue2: {},
 				XQValue2: {},
 				LDValue2: {},
@@ -301,15 +338,14 @@
 				materialList: [],
 				materialUsageList: [],
 				roomList: [],
-				roomCount: 4
+				roomCount: 4,
+				nodeId: ''
 			}
 		},
 		created() {},
 		onLoad() {
+			this.isLeader = getUserType()
 
-			if (this.isLeader) {
-				this.getList()
-			}
 		},
 
 		// 上拉加载
@@ -322,7 +358,12 @@
 				// 显示加载中
 				this.$refs.pullScroll.showUpLoading();
 				this.pageNum++;
-				this.requestData();
+				if (this.tabIndex == 0) {
+					this.requestData();
+				} else {
+					this.requestDataNew();
+				}
+
 			}
 
 		},
@@ -330,6 +371,32 @@
 			isEmpty(str) {
 				return (!str || 0 === str.length);
 			},
+			// 显示二次弹窗
+			handleShowSheet() {
+				this.shareState = true;
+			},
+			// 隐藏二次弹窗
+			handleHiddenShare() {
+				this.shareState = false;
+			},
+
+			chooseNode(item) {
+				this.typeList = item.nodeReViewStateList
+				this.nodeId = item.id;
+				this.handleShowSheet();
+			},
+			showTypeSheet(item) {
+				let obj = {
+					id: this.nodeId,
+					type: item.Type
+				};
+				this.handleHiddenShare();
+				uni.navigateTo({
+					url: '/pages/statistics/historyDetails?params=' + encodeURIComponent(JSON
+						.stringify(
+							obj))
+				})
+			},
 			pickerShow(e) {
 				this.type = e; //赋值类型
 				if (e == 'gczq') { //工程周期
@@ -581,10 +648,14 @@
 			pullDown(pullScroll) {
 
 				this.pageNum = 1;
+
 				setTimeout(() => {
 					this.requestData(pullScroll);
 				}, 1000);
 
+
+
+
 			},
 			getList() {
 				let myThis = this;
@@ -594,10 +665,25 @@
 
 				});
 			},
+			changeTab() {
+				this.pageSize = 10; // 条数
+				this.totalNum = '';
+				this.pageNum = 1; // 页数
+				this.requestData();
+
+			},
 			requestData() {
 
 				uni.showLoading()
-				getNoticeList('1', this.pageNum, this.pageSize).then(res => {
+
+				let type = ''
+				if (this.tabIndex == 0) {
+					type = 'old_renovation'
+				} else {
+					type = 'new_built'
+
+				}
+				gethistoryList(type, user.state.name, this.pageNum, this.pageSize).then(res => {
 
 					this.totalNum = res.total
 
@@ -624,19 +710,22 @@
 
 						} else {
 							this.$modal.msg("暂无数据")
+							this.$refs.pullScroll.empty();
 						}
 					} else {
 						this.$modal.msg(res.msg + "")
+						this.$refs.pullScroll.error();
 					}
 
 				})
 
-			}
+			},
+
 		}
 	}
 </script>
 
-<style>
+<style lang="scss">
 	.to-right-icon {
 		width: 15px;
 		height: 15px;
@@ -878,4 +967,107 @@
 		border-left: 15rpx solid #3857F3;
 		padding-left: 20rpx;
 	}
+
+	.share {
+		width: 100%;
+		height: 100%;
+	}
+
+	.share-box {
+		width: 100%;
+		height: 100%;
+		position: fixed;
+		top: 0rpx;
+		left: 0rpx;
+		bottom: 0rpx;
+		right: 0rpx;
+		background-color: rgba(0, 0, 0, 0.4);
+		transition: .3s;
+		z-index: 999;
+	}
+
+	.share-show {
+		transition: all 0.3s ease;
+		transform: translateY(0%) !important;
+	}
+
+	.scroll-Y {
+		height: 350rpx;
+	}
+
+	.share-item {
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		height: auto;
+		background-color: #FFFFFF;
+		transition: all 0.3s ease;
+		transform: translateY(100%);
+		z-index: 1999;
+		border-top-left-radius: 40rpx;
+		border-top-right-radius: 40rpx;
+
+
+		.share-to {
+			width: 100%;
+			height: 3rem;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+
+			&::after {
+				content: '';
+				width: 240rpx;
+				height: 0rpx;
+				border-top: 1px solid #E4E7ED;
+				-webkit-transform: scaleY(0.5);
+				transform: scaleY(0.5);
+				margin-left: 30rpx;
+			}
+
+			&::before {
+				content: '';
+				width: 240rpx;
+				height: 0rpx;
+				border-top: 1px solid #E4E7ED;
+				-webkit-transform: scaleY(0.5);
+				transform: scaleY(0.5);
+				margin-right: 30rpx;
+			}
+		}
+
+		.content {
+			width: 100%;
+			height: 50%;
+			display: flex;
+			flex-wrap: wrap;
+
+			.block {
+				width: 100%;
+				display: flex;
+				flex-direction: column;
+				justify-content: center;
+				align-items: center;
+				height: 80rpx;
+
+
+
+				text {
+					margin-top: 16rpx;
+					font-size: 28rpx;
+					color: #606266;
+				}
+			}
+		}
+
+		.cancel {
+			width: 100%;
+			height: 3rem;
+			display: flex;
+			justify-content: center;
+			align-items: center;
+			border-top: 1rpx solid #E4E7ED;
+		}
+	}
 </style>

+ 128 - 95
store/modules/user.js

@@ -1,108 +1,141 @@
 import config from '@/config'
 import storage from '@/utils/storage'
 import constant from '@/utils/constant'
-import { login, logout, getInfo } from '@/api/login'
-import { getToken, setToken, removeToken, setUserRole,removeUserRole} from '@/utils/auth'
+import {
+	login,
+	logout,
+	getInfo
+} from '@/api/login'
+import {
+	getToken,
+	setToken,
+	removeToken,
+	setUserRole,
+	removeUserRole,
+	setUserType
+} from '@/utils/auth'
 
 const baseUrl = config.baseUrl
 
 const user = {
-  state: {
-    token: getToken(),
-    name: storage.get(constant.name),
-    avatar: storage.get(constant.avatar),
-    roles: storage.get(constant.roles),
-    permissions: storage.get(constant.permissions),
-	nickName: storage.get(constant.nickName),
-  },
+	state: {
+		token: getToken(),
+		name: storage.get(constant.name),
+		avatar: storage.get(constant.avatar),
+		roles: storage.get(constant.roles),
+		permissions: storage.get(constant.permissions),
+		nickName: storage.get(constant.nickName),
+	},
 
-  mutations: {
-    SET_TOKEN: (state, token) => {
-      state.token = token
-    },
-    SET_NAME: (state, name) => {
-      state.name = name
-      storage.set(constant.name, name)
-    },
-    SET_AVATAR: (state, avatar) => {
-      state.avatar = avatar
-      storage.set(constant.avatar, avatar)
-    },
-    SET_ROLES: (state, roles) => {
-      state.roles = roles
-      storage.set(constant.roles, roles)
-    },
-    SET_PERMISSIONS: (state, permissions) => {
-      state.permissions = permissions
-      storage.set(constant.permissions, permissions)
-    },
-	SET_NICKNAME: (state, nickName) => {
-	  state.nickName = nickName
-	  storage.set(constant.nickName, nickName)
-	}
-  },
+	mutations: {
+		SET_TOKEN: (state, token) => {
+			state.token = token
+		},
+		SET_NAME: (state, name) => {
+			state.name = name
+			storage.set(constant.name, name)
+		},
+		SET_AVATAR: (state, avatar) => {
+			state.avatar = avatar
+			storage.set(constant.avatar, avatar)
+		},
+		SET_ROLES: (state, roles) => {
+			state.roles = roles
+			storage.set(constant.roles, roles)
+		},
+		SET_PERMISSIONS: (state, permissions) => {
+			state.permissions = permissions
+			storage.set(constant.permissions, permissions)
+		},
+		SET_NICKNAME: (state, nickName) => {
+			state.nickName = nickName
+			storage.set(constant.nickName, nickName)
+		}
+	},
+
+	actions: {
+		// 登录
+		Login({
+			commit
+		}, userInfo) {
+			const username = userInfo.username.trim()
+			const password = userInfo.password
+			const code = userInfo.code
+			const uuid = userInfo.uuid
+			const type = userInfo.type
+			return new Promise((resolve, reject) => {
+				login(username, password, code, uuid, type).then(res => {
+					setToken(res.data.token)
+					commit('SET_TOKEN', res.data.token)
+					resolve()
+				}).catch(error => {
+					reject(error)
+				})
+			})
+		},
 
-  actions: {
-    // 登录
-    Login({ commit }, userInfo) {
-      const username = userInfo.username.trim()
-      const password = userInfo.password
-      const code = userInfo.code
-      const uuid = userInfo.uuid
-	  const type = userInfo.type
-      return new Promise((resolve, reject) => {
-        login(username, password, code, uuid,type).then(res => {
-          setToken(res.data.token)
-          commit('SET_TOKEN', res.data.token)
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
+		// 获取用户信息
+		GetInfo({
+			commit,
+			state
+		}) {
+			return new Promise((resolve, reject) => {
+				getInfo().then(res => {
+					const user = res.data.user
+					const avatar = baseUrl + user.avatar
+					const username = (user == null || user.userName == "" || user.userName ==
+						null) ? "" : user.userName
+					const nickName = (user == null || user.nickName == "" || user.nickName ==
+						null) ? "" : user.nickName
+					if (user.roles[0].enginTypeList != null) {
+						setUserRole(user.roles != null ? user.roles[0].enginTypeList.split(",") :
+						[])
+					} else {
+						uni.showToast({
+							title: "暂未分配权限",
+							icon: 'none'
+						})
+						return
+					}
+					setUserType(user.userType)
 
-    // 获取用户信息
-    GetInfo({ commit, state }) {
-      return new Promise((resolve, reject) => {
-        getInfo().then(res => {
-          const user = res.data.user
-          const avatar = baseUrl + user.avatar
-          const username = (user == null || user.userName == "" || user.userName == null) ? "" : user.userName
-		  const nickName = (user == null || user.nickName == "" || user.nickName == null) ? "" : user.nickName
-		  setUserRole(user.roles != null ? user.roles[0].enginTypeList.split(","):[])
-          if (res.data.roles && res.data.roles.length > 0) {
-            commit('SET_ROLES', res.data.roles)
-            commit('SET_PERMISSIONS', res.data.permissions)
-          } else {
-            commit('SET_ROLES', ['ROLE_DEFAULT'])
-          }
-          commit('SET_NAME', username)
-		  commit('SET_NICKNAME', nickName)
-          commit('SET_AVATAR', avatar)
-          resolve(res)
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    },
 
-    // 退出系统
-    LogOut({ commit, state }) {
-      return new Promise((resolve, reject) => {
-        logout(state.token).then(() => {
-          commit('SET_TOKEN', '')
-          commit('SET_ROLES', [])
-          commit('SET_PERMISSIONS', [])
-          removeToken()
-		  removeUserRole()
-          storage.clean()
-          resolve()
-        }).catch(error => {
-          reject(error)
-        })
-      })
-    }
-  }
+					if (res.data.roles && res.data.roles.length > 0) {
+						commit('SET_ROLES', res.data.roles)
+						commit('SET_PERMISSIONS', res.data.permissions)
+					} else {
+						commit('SET_ROLES', ['ROLE_DEFAULT'])
+					}
+					commit('SET_NAME', username)
+					commit('SET_NICKNAME', nickName)
+					commit('SET_AVATAR', avatar)
+					resolve(res)
+				}).catch(error => {
+					reject(error)
+				})
+			})
+		},
+
+		// 退出系统
+		LogOut({
+			commit,
+			state
+		}) {
+			return new Promise((resolve, reject) => {
+				logout(state.token).then(() => {
+					commit('SET_TOKEN', '')
+					commit('SET_ROLES', [])
+					commit('SET_PERMISSIONS', [])
+					removeToken()
+					removeUserRole()
+					storage.clean()
+					resolve()
+				}).catch(error => {
+					reject(error)
+				})
+			})
+		}
+	}
 }
 
-export default user
+export default user

+ 29 - 0
uni_modules/lgd-tab/changelog.md

@@ -0,0 +1,29 @@
+## 1.1.1(2022-11-28)
+- 修复vue3.0导致的点击无反应
+## 1.1.0(2022-11-22)
+### 注意!此版本变更了传值方式与方法名,如从旧版本更新需更新写法
+- 变更传值方式为v-model双向绑定
+- 增加change事件,移除getIndex事件
+- 优化代码结构
+## 1.0.6(2022-06-29)
+- 修复动态传值下标不移动或位置错误
+- 精简代码
+## 1.0.5(2022-03-08)
+- 修复部分问题
+## 1.0.4(2022-03-08)
+- 修复当外部盒子添加padding样式,滑块位置错误问题
+- 区分文字颜色与滑块颜色,分别传入
+- 增加修改组件背景色功能
+- 增加tabIndex参数,无需调用方法修改选中tab
+- 默认隐藏组件滚动条
+- 对vue3.x的支持
+## 1.0.3(2021-03-04)
+去除“windowsWidth”属性,简化代码
+## 1.0.2(2021-03-01)
+新增隐藏滚动条css文件
+更新说明文档
+修复点击第一个tab时横线回弹位置错误问题
+## 1.0.1(2021-02-26)
+修改部分逻辑,支持修改选中tab下标,修复Bug
+## 1.0.0(2021-02-26)
+此版本为发布的第一个版本

+ 12 - 0
uni_modules/lgd-tab/components/lgd-tab/lgd-tab.css

@@ -0,0 +1,12 @@
+::-webkit-scrollbar {
+	display: none;
+	width: 0 !important;
+	height: 0 !important;
+	-webkit-appearance: none;
+	background: transparent;
+}
+
+uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
+	display: none
+}
+

+ 196 - 0
uni_modules/lgd-tab/components/lgd-tab/lgd-tab.vue

@@ -0,0 +1,196 @@
+<template>
+	<view>
+		<view class="tabview">
+			<scroll-view class="scrollView" scroll-x show-scrollbar="false" :scroll-left="scrollLeft"
+				scroll-with-animation style="height: 74rpx;">
+				<view class="tabBox" :style="{ 'justify-content': isOutWindow ? '' : 'space-around'}">
+					<view class="items" v-for="(item, index) in tabValue" :key="index" @click="updateTab(index)">
+						<view class="tabText" :class="index == tIndex ? 'active' : ''"
+							:style="{ 'font-size': fontSize + 'px', color: index == tIndex ? textColor : ''}">
+							{{item}}
+						</view>
+					</view>
+				</view>
+				<view class="underscore"
+					:style="{ width: inderWidth + 'px', 'margin-left': indexLeft + boxLeft + 'px', 'background-color': underlineColor }" />
+			</scroll-view>
+		</view>
+		<view class="gap" style="height: 74rpx;" :style="{'background-color': background }" />
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			value: {
+				type: Number,
+			},
+			modelValue: {
+				type: Number
+			},
+			tabValue: { // tab数据
+				type: Array,
+				default: [],
+				required: true
+			},
+			textColor: { // 颜色
+				type: String,
+				default: '#333'
+			},
+			underlineColor: {
+				type: String,
+				default: '#34b2fa'
+			},
+			fontSize: { // 字体大小
+				type: Number,
+				default: 16
+			},
+			background: {
+				type: String,
+				default: '#fff'
+			}
+		},
+		data() {
+			return {
+				windowsWidth: 0, // 设备窗口大小
+				boxLeft: 0,
+				isOutWindow: false, // tab是否超出屏幕
+				inderWidth: 0, // 下划线宽度
+				indexLeft: 0, // 下划线距左边距离
+				scrollLeft: 0,
+				tIndex: 0, // tab下标
+			};
+		},
+		watch: {
+			// 监听TAB内容更改
+			tabValue: {
+				handler(newValue, oldValue) {
+					this.$nextTick(() => {
+						this.clickTab(this.value || this.modelValue || 0)
+					})
+				},
+				deep: true
+			},
+			modelValue(val) {
+				this.clickTab(val)
+			},
+			value(val) {
+				this.clickTab(val)
+			},
+		},
+		methods: {
+			/// 初始化
+			init() {
+				let that = this;
+				// 判断tab是否超出屏幕
+				uni.createSelectorQuery().in(this).selectAll(".items").boundingClientRect().exec((data) => {
+					if (data[0][that.tabValue.length - 1].right > that.windowsWidth) {
+						that.isOutWindow = true
+					}
+					that.$nextTick(() => {
+						that.clickTab(that.value || that.modelValue || 0)
+					})
+				})
+			},
+			
+			updateTab(index) {
+				// #ifndef VUE3
+				this.$emit('input', index)
+				// #endif
+				// #ifdef VUE3
+				this.$emit('update:modelValue', index)
+				// #endif
+			},
+
+			/// 点击TAB
+			clickTab(index) {
+				// 更改选中下标
+				this.tIndex = index
+				this.$emit("change", index)
+				// 获取盒子移动距离
+				if (this.isOutWindow && index >= 0) {
+					uni.createSelectorQuery().in(this).select(".tabBox").boundingClientRect().exec((data) => {
+						if (index == 0) {
+							this.boxLeft = 0
+						} else {
+							// 移动距离
+							this.boxLeft = -data[0].left
+						}
+					})
+				}
+				uni.createSelectorQuery().in(this).selectAll(".items").boundingClientRect().exec((data) => {
+					let width = data[0][index].width
+					let left = data[0][index].left
+					let newLeft = 0
+					// tab超出屏幕
+					if (this.isOutWindow) {
+						if (index == 0) {
+							left = 0
+						}
+						// 防止移动后距离缩短问题
+						for (let i = 0; i < index; i++) {
+							newLeft += data[0][i].width
+						}
+						// 是否需要居中
+						if (this.windowsWidth / 2 < newLeft + width) {
+							this.scrollLeft = width / 2 - (this.windowsWidth / 2 - newLeft)
+						} else {
+							this.scrollLeft = 0
+						}
+					}
+					// 点击tab宽度
+					this.inderWidth = width / 2
+					// 移动距离
+					this.indexLeft = (width - width / 2) / 2 + left
+				})
+			},
+		},
+		mounted() {
+			// 获取屏幕宽度
+			this.windowsWidth = uni.getSystemInfoSync().windowWidth
+			// 初始化
+			this.init()
+		}
+	}
+</script>
+
+<style>
+	.tabview {
+		width: 100vw;
+		position: absolute;
+		left: 0;
+	}
+
+	.scrollView {
+		width: 100%;
+		white-space: nowrap;
+	}
+
+	.tabBox {
+		display: flex;
+		align-items: center;
+	}
+
+	.items {
+		line-height: 60rpx;
+		padding: 0 20rpx;
+	}
+
+	.tabText {
+		color: #666666;
+	}
+
+	.active {
+		font-weight: bold;
+	}
+
+	.underscore {
+		height: 3px;
+		transition: .2s all;
+		border-radius: 6rpx;
+	}
+
+	/deep/.uni-scroll-view::-webkit-scrollbar {
+		display: none
+	}
+</style>

+ 76 - 0
uni_modules/lgd-tab/package.json

@@ -0,0 +1,76 @@
+{
+    "id": "lgd-tab",
+    "name": "Tab组件",
+    "version": "1.1.1",
+    "description": "简单易用的Tab组件",
+    "keywords": [
+        "tab,组件"
+    ],
+    "displayName": "Tab组件",
+    "repository": "https://github.com/MyZear/LgdTab.git",
+    "engines": {
+        "HBuilderX": "^3.2.15"
+    },
+    "dcloudext": {
+        "sale": {
+            "regular": {
+                "price": "0.00"
+            },
+            "sourcecode": {
+                "price": "0.00"
+            }
+        },
+        "contact": {
+            "qq": ""
+        },
+        "declaration": {
+            "ads": "无",
+            "data": "插件不采集任何数据",
+            "permissions": "无"
+        },
+        "npmurl": "",
+        "type": "component-vue"
+    },
+    "uni_modules": {
+        "platforms": {
+            "cloud": {
+                "tcb": "y",
+                "aliyun": "y"
+            },
+            "client": {
+                "App": {
+                    "app-vue": "y",
+                    "app-nvue": "u"
+                },
+                "H5-mobile": {
+                    "Safari": "y",
+                    "Android Browser": "y",
+                    "微信浏览器(Android)": "y",
+                    "QQ浏览器(Android)": "y"
+                },
+                "H5-pc": {
+                    "Chrome": "y",
+                    "IE": "u",
+                    "Edge": "y",
+                    "Firefox": "y",
+                    "Safari": "y"
+                },
+                "小程序": {
+                    "微信": "y",
+                    "阿里": "u",
+                    "百度": "u",
+                    "字节跳动": "u",
+                    "QQ": "u"
+                },
+                "快应用": {
+                    "华为": "u",
+                    "联盟": "u"
+                },
+                "Vue": {
+                    "vue2": "y",
+                    "vue3": "y"
+                }
+            }
+        }
+    }
+}

+ 40 - 0
uni_modules/lgd-tab/readme.md

@@ -0,0 +1,40 @@
+### 1.1.0版本起变更了传值方式与方法名,如从旧版本更新需更新写法
+
+## 基础用法
+> template
+
+	<lgd-tab v-model="tabIndex" :tabValue="tabValue" />
+
+> script
+
+	export default {
+		data() {
+			return {
+				tabValue: ['示例1',  '示例2'],
+				tabIndex: 0
+			}
+		}
+	}
+
+## 参数说明
+| 参数名 | 说明 | 默认 | 是否必填 | 参数类型 |
+|:-----|---|-----|:-----:|:-----:|
+|tabValue|tab列表| - |是| Array |
+|tabIndex|tab选中下标|0|否| NumBer |
+|textColor|文字颜色|#333|否|String|
+|underlineColor|滑块颜色|#34b2fa|否|String|
+|fontSize|字体大小|16|否|NumBer|
+|background|组件背景颜色|#fff|否|String|
+
+## 事件
+| 事件名 | 说明 | 回调参数 |
+|:-----|-------|:-----:|
+|change|监听TAB切换|index |
+
+## 样式
+
+App.vue中引入css
+
+	<style>
+		@import url("./components/lgd-tab/lgd-tab.css");
+	</style>

+ 13 - 0
utils/auth.js

@@ -1,5 +1,6 @@
 const TokenKey = 'App-Token'
 const UserRole = 'App-UserRole'
+const UserType = 'App-UserType'
 
 export function getToken() {
   return uni.getStorageSync(TokenKey)
@@ -24,3 +25,15 @@ export function setUserRole(role) {
 export function removeUserRole() {
   return uni.removeStorageSync(UserRole)
 }
+
+export function getUserType() {
+  return uni.getStorageSync(UserType)
+}
+
+export function setUserType(type) {
+  return uni.setStorageSync(UserType,type)
+}
+
+export function removeUserType() {
+  return uni.removeStorageSync(UserType)
+}