Bladeren bron

拆旧管

zhnghongrui 1 jaar geleden
bovenliggende
commit
aeeec91a72

+ 29 - 27
api/common.js

@@ -1,46 +1,48 @@
 import request from '@/utils/request'
 
+
+
 // 获取小区字典值
-export function getAreaList() {
-	// const data = {
-	//   district
-	// }
-  return request({
-    'url': '/zdsz/area/getAreaList',
-    'method': 'get',
-	// 'data': data
-  })
+export function getAreaList(district) {
+	const data = {
+		district
+	}
+	return request({
+		'url': '/zdsz/area/getAreaList',
+		'method': 'get',
+		'data': data
+	})
 }
 // 获取楼宇字典值
 export function getBuildingList(areaId) {
 	const data = {
-	  areaId
+		areaId
 	}
-  return request({
-    'url': '/zdsz/building/getBuildingList',
-    'method': 'get',
-	'data': data
-  })
+	return request({
+		'url': '/zdsz/building/getBuildingList',
+		'method': 'get',
+		'data': data
+	})
 }
 // 获取单元字典值
 export function getUnitList(buildingId) {
 	const data = {
-	  buildingId
+		buildingId
 	}
-  return request({
-    'url': '/zdsz/unit/getUnitList',
-    'method': 'get',
-	'data': data
-  })
+	return request({
+		'url': '/zdsz/unit/getUnitList',
+		'method': 'get',
+		'data': data
+	})
 }
 // 获取房间字典值
 export function getHousesList(unitId) {
 	const data = {
-	  unitId
+		unitId
 	}
-  return request({
-    'url': '/zdsz/house/getHousesList',
-    'method': 'get',
-	'data': data
-  })
+	return request({
+		'url': '/zdsz/house/getHousesList',
+		'method': 'get',
+		'data': data
+	})
 }

+ 10 - 0
api/system/dict/data.js

@@ -0,0 +1,10 @@
+import upload from '@/utils/upload'
+import request from '@/utils/request'
+
+// 根据字典类型查询字典数据信息
+export function getDicts(dictType) {
+  return request({
+    url: '/system/dict/data/type/' + dictType,
+    method: 'get'
+  })
+}

+ 5 - 3
main.js

@@ -3,15 +3,17 @@ import App from './App'
 import store from './store' // store
 import plugins from './plugins' // plugins
 import './permission' // permission
+import config from '@/config'
 Vue.use(plugins)
 
 Vue.config.productionTip = false
 Vue.prototype.$store = store
 
 App.mpType = 'app'
-
+// 挂载全局图片地址
+Vue.prototype.$HTTP = config.baseUrl
 const app = new Vue({
-  ...App
+	...App
 })
 
-app.$mount()
+app.$mount()

+ 465 - 18
pages/oldrenovation/indoor/putUpWatch.vue

@@ -1,22 +1,469 @@
-<template>
-	<view>
-		
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				
+	<template>
+		<view>
+			<view class="background">
+				<view class="uni-list">
+					<view class="container">
+						<view>
+							行政区
+						</view>
+						<view v-if="this.isEmpty(this.XZQValue.dictValue)" style="margin-top: 10;"
+							@click="pickerShow('xzq')">
+							<span style="color: darkgray;">请选择行政区</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
+							<span style="color: black;">{{XZQValue.dictLabel}}</span>
+						</view>
+
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+						<view>
+							小区
+						</view>
+
+						<view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('xq')">
+							<span style="color: darkgray;">请选择小区</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xq')">
+							<span style="color: black;">{{XQValue.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							楼栋
+						</view>
+						<view v-if="this.isEmpty(this.LDValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('ld')">
+							<span style="color: darkgray;">请选择楼栋</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('ld')">
+							<span style="color: black;">{{LDValue.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="uni-list" style="margin-top: 10;">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							单元
+						</view>
+						<view v-if="this.isEmpty(this.DYValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('dy')">
+							<span style="color: darkgray;">请选择单元</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('dy')">
+							<span style="color: black;">{{DYValue.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							房间
+						</view>
+						<view v-if="this.isEmpty(this.FJValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('fj')">
+							<span style="color: darkgray;">请选择房间</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fj')">
+							<span style="color: black;">{{FJValue.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="container">
+
+					<view class="title">是否按照施工图纸施工</view>
+					<switch style="transform: scale(0.6,0.6);" @change="switch2Change" />
+
+				</view>
+
+				<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
+					subtitleKey="id" v-model="name"></SelectPicker>
+
+
+				<SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
+					titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
+			</view>
+
+
+			<view class="background">
+				<view class="uni-list">
+					<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
+						立杠
+
+						<span
+							style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;">历史</span>
+					</view>
+
+					<view class="container">
+
+						<view>
+							品 牌
+						</view>
+						<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
+							<span>{{attributeXZQ}}</span>
+						</view>
+					</view>
+					
+					<view class="number">
+						<text>数 量</text> <!-- 左边文字 -->
+						<input type="number" v-model="number"class="input" placeholder="请填写数量" style="margin-left: 10px;"></input>
+						<!-- 右边输入框 -->
+					</view>
+				</view>
+
+				<view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
+					<view class="container" style="color: gainsboro;">*请上传照片</view>
+					<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
+						<image src="/static/images/chooseimg.png" mode=""
+							style="width: 190rpx; height: 190rpx; margin: 0 12rpx;; " @click="chooseimage()"></image>
+						<view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
+							<view>
+								<image :src="item" mode="" style="width: 190rpx; height: 190rpx; margin: 0 12rpx;"
+									@click="showPhoto(index)">
+								</image>
+							</view>
+
+							<view @click="remove(index)"
+								style="position: absolute; top: 0; right: 14rpx; border-radius: 50%; background-color: #FF0000;">
+								<u-icon name="close" color="#FFFFFF" size="35"></u-icon>
+							</view>
+						</view>
+					</view>
+
+				</view>
+			</view>
+
+			<view class="action-btn">
+				<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 {
+			getAreaList,
+			getBuildingList,
+			getUnitList,
+			getHousesList
+		} from '@/api/common'
+
+		export default {
+			components: {
+				SelectPicker
+			},
+			data() {
+
+				return {
+					number: '',
+					type: '',
+					open: false,
+					openDict: false,
+					selectList: [],
+					dictOptions: [],
+					imgArr: [],
+					XQValue: {},
+					XZQValue: {},
+					LDValue: {},
+					DYValue: {},
+					FJValue: {},
+					FSValue: {},
+					XQList: '',
+					LDList: '',
+					DYList: '',
+					FJList: '',
+					progress: 0, //上传图片进度百分比
+					loading: false
+
+
+				}
+			},
+
+			created() {
+				getDicts("district").then(response => {
+					this.dictOptions = response;
+				});
+
+
+			},
+			onLoad() {
+				uni.setNavigationBarTitle({
+					title: '旧改工程-室内'
+				})
+			},
+			methods: {
+				//判断是否选择
+				isEmpty(str) {
+
+					return (!str || 0 === str.length);
+
+				},
+				showPhoto(index) {
+					uni.previewImage({
+						current: index,
+						urls: this.imgArr,
+					})
+					console.log('sss')
+				},
+				remove(index) {
+					uni.showModal({
+						title: '提示',
+						content: '是否删除该图片或视频?',
+						success: (res) => {
+							if (res.confirm) {
+								this.imgArr.splice(index, 1)
+								console.log('this.imgarr', this.imgArr)
+								if (this.imgArr.length <= 0) {
+									this.photo = true;
+								}
+							}
+						}
+					})
+				},
+				chooseimage() {
+					console.log('图片')
+					let _this = this;
+					uni.chooseImage({
+						sizeType: ['album', 'camera'],
+						success(resp) {
+							console.log('res--uni.chooseMedia', resp);
+							resp.tempFiles.forEach((item, index) => {
+								const task = uni.uploadFile({
+									url: _this.$HTTP.webUrl + `/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;
+										if (![200, 201, 204].includes(res.statusCode)) {
+											// this.uploadError(index, data);
+											_this.$modal.msg('上传失败!')
+										} else {
+											if (_this.progress === 100) {
+												console.log('_this.progress', _this.progress)
+												console.log('data----', data)
+												console.log('res--', res)
+												_this.imgArr.push(data.data.url)
+												console.log('imgArr', _this.imgArr)
+												_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;
+									console.log('onProgressUpdate', res)
+									console.log('task.onProgressUpdate', _this.progress)
+									uni.showLoading({
+										title: '上传中'
+									})
+									if (_this.progress != 100) {
+										_this.loading = false
+										console.log('_this.loading false', _this.loading)
+									} else {
+										_this.loading = true
+										console.log('_this.loading true', _this.loading)
+									}
+								});
+
+							})
+
+						},
+					})
+				},
+				pickerShow(e) {
+
+
+					this.type = e; //赋值类型
+					if (e == 'xzq') { //行政区
+						this.openDict = true;
+						//this.selectList = this.dictOptions;
+
+					} else if (e == 'xq') { //小区
+						if (this.isEmpty(this.XZQValue.dictValue)) {
+							this.$modal.msg('请选择行政区')
+
+						} else {
+							this.open = true;
+							this.selectList = this.XQList;
+						}
+					} else if (e == 'ld') { //楼栋
+
+						if (this.isEmpty(this.XQValue.id)) {
+							this.$modal.msg('请选择小区')
+
+						} else {
+							this.open = true;
+							this.selectList = this.LDList;
+						}
+
+					} else if (e == 'dy') { //单元
+						if (this.isEmpty(this.LDValue.id)) {
+							this.$modal.msg('请选择楼栋')
+
+						} else {
+							this.open = true;
+							this.selectList = this.DYList;
+						}
+					} else if (e == 'fj') { //房间
+						if (this.isEmpty(this.DYValue.id)) {
+							this.$modal.msg('请选择单元')
+
+						} else {
+							this.open = true;
+							this.selectList = this.FJList;
+						}
+					}
+
+				},
+
+
+				switch2Change(e) {
+					console.log('switch2 发生 change 事件,携带值为', e.detail.value)
+				},
+				changeSelectDict(item, index) {
+					this.openDict = false;
+					this.XZQValue = item;
+
+					//根据行政区id获取小区数据
+					this.XQValue.name = ''; //重置楼栋数据
+					this.LDValue.name = ''; //重置楼栋数据
+					this.DYValue.name = ''; //重置单元数据
+					this.FJValue.name = ''; //重置房间数据
+					getAreaList(item.dictValue).then(res => {
+						this.XQList = res;
+					})
+
+				},
+				changeSelect(item, index) {
+					// this.index = index;
+					// this.address = item.communityName;
+					this.open = false;
+
+					if (this.type == 'xq') {
+						this.XQValue = item;
+						//根据小区id 获取楼栋数据
+						this.LDValue.name = ''; //重置楼栋数据
+						this.DYValue.name = ''; //重置单元数据
+						this.FJValue.name = ''; //重置房间数据
+						getBuildingList(item.id).then(res => {
+							this.LDList = res
+							// console.log("楼栋=", res)
+						})
+					} else if (this.type == 'ld') {
+						this.LDValue = item;
+						//根据楼栋ID 获取单元数据
+						this.DYValue.name = ''; //重置单元数据
+						this.FJValue.name = ''; //重置房间数据
+						getUnitList(item.id).then(res => {
+							this.DYList = res
+							// console.log("单元=", res)
+						})
+					} else if (this.type == 'dy') {
+						this.DYValue = item;
+						//根据单元数据 获取房间数据 
+						this.FJValue.name = ''; //重置房间数据
+						getHousesList(item.id).then(res => {
+							this.FJList = res
+							// console.log("房间=", res)
+						})
+					} else if (this.type == 'fj') {
+						this.FJValue = item;
+					}
+
+				},
+				//关闭弹窗
+				close(e) {
+					this.open = false
+				},
+				//关闭弹窗
+				closeDict(e) {
+					this.openDict = false
+				},
+				//提交数据
+				submit() {
+					if (this.isEmpty(this.XZQValue.dictValue)) {
+						this.$modal.msg("请选择行政区")
+					} else if (this.isEmpty(this.XQValue.id)) {
+						this.$modal.msg("请选择小区")
+					} else if (this.isEmpty(this.LDValue.id)) {
+						this.$modal.msg("请选择楼栋")
+					} else if (this.isEmpty(this.DYValue.id)) {
+						this.$modal.msg("请选择单元")
+					} else if (this.isEmpty(this.FJValue.id)) {
+						this.$modal.msg("请选择房间")
+					} else if (this.imgArr.length <= 0) {
+						this.$modal.msg('请上传照片')
+					} else if (this.loading == false) {
+						this.$modal.msg('照片未上传完毕,无法提交!')
+					}
+				}
+
 			}
-		},
-		methods: {
-			
 		}
-	}
-</script>
+	</script>
+
+	<style>
+		.container {
+			display: flex;
+			margin-left: 10px;
+			margin-top: 10px;
+			margin-right: 10px;
+			align-items: flex-start;
+			justify-content: space-between;
+		}
 
-<style>
+		.number {
+			display: flex;
+			/* 水平居中显示子元素 */
+			align-items: flex-start;
+			/* 垂直居中显示子元素 */
+			justify-content: space-between;
+			/* 左右间距等于间距大小 */
+			padding: 10px;
+			/* 设置padding以提高视觉效果 */
+		}
+
+		.text {
+			font-size: 16px;
+			color: #333;
+		}
+
+		.background {
+			border: 15px solid hsla(0, 0%, 100%, .5);
+			background: white;
+			background-clip: padding-box;
+			/*从padding开始往外面裁剪背景*/
 
-</style>
+		}
+
+		.btn {
+			margin-top: 40px;
+			margin-right: 20px;
+			margin-bottom: 20px;
+			margin-left: 20px;
+			height: 45px;
+		}
+	</style>

+ 318 - 91
pages/oldrenovation/indoor/tearOldPipe.vue

@@ -1,53 +1,143 @@
 	<template>
-		<view class="background">
-			<view class="uni-list">
-				<view class="container">
-					<view>
-						小区
-					</view>
-					<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xq')">
-						<span>{{attributeXQ}}</span>
+		<view>
+			<view class="background">
+				<view class="uni-list">
+					<view class="container">
+						<view>
+							行政区
+						</view>
+						<view v-if="this.isEmpty(this.XZQValue.dictValue)" style="margin-top: 10;"
+							@click="pickerShow('xzq')">
+							<span style="color: darkgray;">请选择行政区</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
+							<span style="color: black;">{{XZQValue.dictLabel}}</span>
+						</view>
+
 					</view>
 				</view>
-			</view>
-			<view class="uni-list">
-				<view class="container">
-					<view class="uni-list-cell-left">
-						楼栋
+				<view class="uni-list">
+					<view class="container">
+						<view>
+							小区
+						</view>
+
+						<view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('xq')">
+							<span style="color: darkgray;">请选择小区</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xq')">
+							<span style="color: black;">{{XQValue.name}}</span>
+						</view>
 					</view>
-					<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('ld')">
-						<span>{{attributeLD}}</span>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							楼栋
+						</view>
+						<view v-if="this.isEmpty(this.LDValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('ld')">
+							<span style="color: darkgray;">请选择楼栋</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('ld')">
+							<span style="color: black;">{{LDValue.name}}</span>
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="uni-list" style="margin-top: 10;">
-				<view class="container">
-					<view class="uni-list-cell-left">
-						单元
+				<view class="uni-list" style="margin-top: 10;">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							单元
+						</view>
+						<view v-if="this.isEmpty(this.DYValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('dy')">
+							<span style="color: darkgray;">请选择单元</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('dy')">
+							<span style="color: black;">{{DYValue.name}}</span>
+						</view>
 					</view>
-					<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('dy')">
-						<span>{{attributeDY}}</span>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							房间
+						</view>
+						<view v-if="this.isEmpty(this.FJValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('fj')">
+							<span style="color: darkgray;">请选择房间</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fj')">
+							<span style="color: black;">{{FJValue.name}}</span>
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="uni-list">
 				<view class="container">
-					<view class="uni-list-cell-left">
-						房间
+
+					<view class="title">是否按照施工图纸施工</view>
+					<switch style="transform: scale(0.6,0.6);" @change="switch2Change" />
+
+				</view>
+
+				<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
+					subtitleKey="id" v-model="name"></SelectPicker>
+
+
+				<SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
+					titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
+			</view>
+
+
+			<view class="background">
+				<view class="uni-list">
+					<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
+						拆旧管
+
+						<span
+							style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;">历史</span>
 					</view>
-					<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fj')">
-						<span>{{attributeFJ}}</span>
+
+					<view class="container">
+
+						<view>
+							腐蚀等级
+						</view>
+						<view v-if="this.isEmpty(this.LevelValue.dictValue)" style="margin-top: 10;"
+							@click="pickerShow('fsdj')">
+							<span style="color: darkgray;">请选择腐蚀等级</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fsdj')">
+							<span style="color: black;">{{LevelValue.dictLabel}}</span>
+						</view>
 					</view>
 				</view>
-			</view>
-			<view class="container">
 
-				<view class="title">是否按照施工图纸施工</view>
-				<switch checked @change="switch2Change" />
+				<view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
+					<view class="container" style="color: gainsboro;">*请上传照片</view>
+					<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
+						<image src="/static/images/chooseimg.png" mode=""
+							style="width: 190rpx; height: 190rpx; margin: 0 12rpx;; " @click="chooseimage()"></image>
+						<view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
+							<view>
+								<image :src="item" mode="" style="width: 190rpx; height: 190rpx; margin: 0 12rpx;"
+									@click="showPhoto(index)">
+								</image>
+							</view>
+
+							<view @click="remove(index)"
+								style="position: absolute; top: 0; right: 14rpx; border-radius: 50%; background-color: #FF0000;">
+								<u-icon name="close" color="#FFFFFF" size="35"></u-icon>
+							</view>
+						</view>
+					</view>
 
+				</view>
+			</view>
+
+			<view class="action-btn">
+				<button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
 			</view>
-			<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
-				subtitleKey="id" v-model="name"></SelectPicker>
 		</view>
 	</template>
 
@@ -56,11 +146,17 @@
 	<script>
 		import SelectPicker from '../../../components/selectPicker/select_picker.vue'
 		import {
+			getDicts
+		} from "@/api/system/dict/data";
+		import {
 			getAreaList,
 			getBuildingList,
 			getUnitList,
-			getHousesList
+			getHousesList,
 		} from '@/api/common'
+		import {
+			getToken
+		} from '../../../utils/auth';
 
 		export default {
 			components: {
@@ -69,32 +165,36 @@
 			data() {
 
 				return {
-
+					headers: {
+						Authorization: "Bearer " + getToken()
+					},
 					type: '',
 					open: false,
+					openDict: false,
 					selectList: [],
-
+					dictOptions: [],
+					imgArr: [],
 					XQValue: {},
+					XZQValue: {},
+					LevelValue: {},
 					LDValue: {},
 					DYValue: {},
 					FJValue: {},
+					FSValue: {},
 					XQList: '',
-					index: 0,
-					address: null,
-					title: 'picker',
-					transformerValue: '请选择楼栋',
-
 					LDList: '',
 					DYList: '',
 					FJList: '',
+					progress: 0, //上传图片进度百分比
+					loading: false
 
 
 				}
 			},
+
 			created() {
-				getAreaList().then(res => {
-					this.XQList = res;
-				})
+
+
 
 			},
 			onLoad() {
@@ -102,21 +202,6 @@
 					title: '旧改工程-室内'
 				})
 			},
-			computed: {
-				attributeXQ() {
-					return this.XQValue.name ? this.XQValue.name : "请选择小区"
-
-				},
-				attributeLD() {
-					return this.LDValue.name ? this.LDValue.name : "请选择楼栋"
-				},
-				attributeDY() {
-					return this.DYValue.name ? this.DYValue.name : "请选择单元"
-				},
-				attributeFJ() {
-					return this.FJValue.name ? this.FJValue.name : "请选择房间"
-				}
-			},
 			methods: {
 				//判断是否选择
 				isEmpty(str) {
@@ -124,47 +209,146 @@
 					return (!str || 0 === str.length);
 
 				},
-				pickerShow(e) {
+				showPhoto(index) {
+					uni.previewImage({
+						current: index,
+						urls: this.imgArr,
+					})
+					console.log('sss')
+				},
+				remove(index) {
+					uni.showModal({
+						title: '提示',
+						content: '是否删除该图片或视频?',
+						success: (res) => {
+							if (res.confirm) {
+								this.imgArr.splice(index, 1)
+								console.log('this.imgarr', this.imgArr)
+								if (this.imgArr.length <= 0) {
+									this.photo = true;
+								}
+							}
+						}
+					})
+				},
+				chooseimage() {
+
+
+					let _this = this;
+					console.log('图片', _this.headers)
+					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格式
+										console.log("结果", res)
+										// 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) {
+												console.log('_this.progress', _this.progress)
+												//console.log('data----', data)data
+												console.log('res--', res)
+												_this.imgArr.push(data.data.url)
+												console.log('imgArr', _this.imgArr)
+												_this.$modal.msg('上传成功!')
+												_this.photo = false;
+											}
+										}
+									},
+									fail: e => {
+										console.log(e)
+										_this.$modal.msg('上传失败!')
+										//_this.uploadError(index, e);
+									},
+									complete: res => {
+										uni.hideLoading();
+										_this.uploading = false;
 
+									}
+								});
+								task.onProgressUpdate(res => {
+									_this.progress = res.progress;
+									console.log('onProgressUpdate', res)
+									console.log('task.onProgressUpdate', _this.progress)
+									uni.showLoading({
+										title: '上传中'
+									})
+									if (_this.progress != 100) {
+										_this.loading = false
+										console.log('_this.loading false', _this.loading)
+									} else {
+										_this.loading = true
+										console.log('_this.loading true', _this.loading)
+									}
+								});
+
+							})
+
+						},
+					})
+				},
+				pickerShow(e) {
 					this.type = e; //赋值类型
-					if (e == 'xq') {
-						this.open = true;
-						this.selectList = this.XQList;
-					} else if (e == 'ld') {
+					if (e == 'fsdj') {
+						//腐蚀等级
+						this.openDict = true;
+						//腐蚀等级
+						getDicts("corrosion_level").then(response => {
+							console.log(response)
+							this.dictOptions = response;
+						});
+
+					}
+					if (e == 'xzq') { //行政区
+						this.openDict = true;
+						getDicts("district").then(response => {
+							this.dictOptions = response;
+						});
+						//this.selectList = this.dictOptions;
+
+					} else if (e == 'xq') { //小区
+						if (this.isEmpty(this.XZQValue.dictValue)) {
+							this.$modal.msg('请选择行政区')
+
+						} else {
+							this.open = true;
+							this.selectList = this.XQList;
+						}
+					} else if (e == 'ld') { //楼栋
 
 						if (this.isEmpty(this.XQValue.id)) {
-							uni.showToast({
-								title: '请选择小区',
-								icon: 'error',
-								duration: 1000
-							});
+							this.$modal.msg('请选择小区')
 
 						} else {
 							this.open = true;
 							this.selectList = this.LDList;
 						}
 
-					} else if (e == 'dy') {
+					} else if (e == 'dy') { //单元
 						if (this.isEmpty(this.LDValue.id)) {
-							uni.showToast({
-								title: '请选择楼栋',
-								icon: 'error',
-								duration: 1000
+							this.$modal.msg('请选择楼栋')
 
-							});
 						} else {
 							this.open = true;
 							this.selectList = this.DYList;
 						}
-					} else if (e == 'fj') {
+					} else if (e == 'fj') { //房间
 						if (this.isEmpty(this.DYValue.id)) {
-							uni.showToast({
-								title: '请选择单元',
-								icon: 'error',
-								duration: 1000
+							this.$modal.msg('请选择单元')
 
-							});
 						} else {
 							this.open = true;
 							this.selectList = this.FJList;
@@ -172,20 +356,33 @@
 					}
 
 				},
-				bindPickerChange(e) {
-					console.log('picker发送选择改变,携带值为', e.detail.value)
-					this.index = e.detail.value
-				},
-				bindDateChange(e) {
-					this.date = e.detail.value
-				},
+
+
 				switch2Change(e) {
 					console.log('switch2 发生 change 事件,携带值为', e.detail.value)
 				},
+				changeSelectDict(item, index) {
+					this.openDict = false;
+					if (this.type == 'xzq') {
+						this.XZQValue = item;
+
+						//根据行政区id获取小区数据
+						this.XQValue.name = ''; //重置小区数据
+						this.LDValue.name = ''; //重置楼栋数据
+						this.DYValue.name = ''; //重置单元数据
+						this.FJValue.name = ''; //重置房间数据
+						getAreaList(item.dictValue).then(res => {
+							this.XQList = res;
+						})
+					} else {
+						this.LevelValue = item;
+					}
+				},
 				changeSelect(item, index) {
-					this.index = index;
-					this.address = item.communityName;
+					// this.index = index;
+					// this.address = item.communityName;
 					this.open = false;
+
 					if (this.type == 'xq') {
 						this.XQValue = item;
 						//根据小区id 获取楼栋数据
@@ -221,7 +418,30 @@
 				//关闭弹窗
 				close(e) {
 					this.open = false
+				},
+				//关闭弹窗
+				closeDict(e) {
+					this.openDict = false
+				},
+				//提交数据
+				submit() {
+					if (this.isEmpty(this.XZQValue.dictValue)) {
+						this.$modal.msg("请选择行政区")
+					} else if (this.isEmpty(this.XQValue.id)) {
+						this.$modal.msg("请选择小区")
+					} else if (this.isEmpty(this.LDValue.id)) {
+						this.$modal.msg("请选择楼栋")
+					} else if (this.isEmpty(this.DYValue.id)) {
+						this.$modal.msg("请选择单元")
+					} else if (this.isEmpty(this.FJValue.id)) {
+						this.$modal.msg("请选择房间")
+					} else if (this.imgArr.length <= 0) {
+						this.$modal.msg('请上传照片')
+					} else if (this.loading == false) {
+						this.$modal.msg('照片未上传完毕,无法提交!')
+					}
 				}
+
 			}
 		}
 	</script>
@@ -247,6 +467,13 @@
 			background-clip: padding-box;
 			/*从padding开始往外面裁剪背景*/
 
+		}
 
+		.btn {
+			margin-top: 40px;
+			margin-right: 20px;
+			margin-bottom: 120px;
+			margin-left: 20px;
+			height: 45px;
 		}
 	</style>

+ 473 - 18
pages/oldrenovation/indoor/verticalBar.vue

@@ -1,22 +1,477 @@
-<template>
-	<view>
-		
-	</view>
-</template>
-
-<script>
-	export default {
-		data() {
-			return {
-				
+	<template>
+		<view>
+			<view class="background">
+				<view class="uni-list">
+					<view class="container">
+						<view>
+							行政区
+						</view>
+						<view v-if="this.isEmpty(this.XZQValue.dictValue)" style="margin-top: 10;"
+							@click="pickerShow('xzq')">
+							<span style="color: darkgray;">请选择行政区</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
+							<span style="color: black;">{{XZQValue.dictLabel}}</span>
+						</view>
+
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+						<view>
+							小区
+						</view>
+
+						<view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('xq')">
+							<span style="color: darkgray;">请选择小区</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xq')">
+							<span style="color: black;">{{XQValue.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							楼栋
+						</view>
+						<view v-if="this.isEmpty(this.LDValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('ld')">
+							<span style="color: darkgray;">请选择楼栋</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('ld')">
+							<span style="color: black;">{{LDValue.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="uni-list" style="margin-top: 10;">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							单元
+						</view>
+						<view v-if="this.isEmpty(this.DYValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('dy')">
+							<span style="color: darkgray;">请选择单元</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('dy')">
+							<span style="color: black;">{{DYValue.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="uni-list">
+					<view class="container">
+						<view class="uni-list-cell-left">
+							房间
+						</view>
+						<view v-if="this.isEmpty(this.FJValue.id)" class="uni-list-cell-db" style="margin-top: 10;"
+							@click="pickerShow('fj')">
+							<span style="color: darkgray;">请选择房间</span>
+						</view>
+						<view v-else class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('fj')">
+							<span style="color: black;">{{FJValue.name}}</span>
+						</view>
+					</view>
+				</view>
+				<view class="container">
+
+					<view class="title">是否按照施工图纸施工</view>
+					<switch style="transform: scale(0.6,0.6);" @change="switch2Change" />
+
+				</view>
+
+				<SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
+					subtitleKey="id" v-model="name"></SelectPicker>
+
+
+				<SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
+					titleKey="dictLabel" subtitleKey="dictValue" v-model="dictLabel"></SelectPicker>
+			</view>
+
+
+			<view class="background">
+				<view class="uni-list">
+					<view style="font-size: 16px;margin-left: 10px;margin-top: 10px;">
+						立杠
+
+						<span
+							style="color: blue;font-size: 14px;  display: flex;justify-content:flex-end; margin-right: 15px;">历史</span>
+					</view>
+
+					<view class="container">
+
+						<view>
+							材 质
+						</view>
+						<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
+							<span>{{attributeXZQ}}</span>
+						</view>
+					</view>
+					<view class="container">
+
+						<view>
+							规 格
+						</view>
+						<view class="uni-list-cell-db" style="margin-top: 10;" @click="pickerShow('xzq')">
+							<span>{{attributeXZQ}}</span>
+						</view>
+					</view>
+					<view class="number">
+						<text>数 量</text> <!-- 左边文字 -->
+						<input type="number" v-model="number"class="input" placeholder="请填写数量" style="margin-left: 10px;"></input>
+						<!-- 右边输入框 -->
+					</view>
+				</view>
+
+				<view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
+					<view class="container" style="color: gainsboro;">*请上传照片</view>
+					<view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
+						<image src="/static/images/chooseimg.png" mode=""
+							style="width: 190rpx; height: 190rpx; margin: 0 12rpx;; " @click="chooseimage()"></image>
+						<view v-for="(item,index) in imgArr" :key="index" style="position: relative;">
+							<view>
+								<image :src="item" mode="" style="width: 190rpx; height: 190rpx; margin: 0 12rpx;"
+									@click="showPhoto(index)">
+								</image>
+							</view>
+
+							<view @click="remove(index)"
+								style="position: absolute; top: 0; right: 14rpx; border-radius: 50%; background-color: #FF0000;">
+								<u-icon name="close" color="#FFFFFF" size="35"></u-icon>
+							</view>
+						</view>
+					</view>
+
+				</view>
+			</view>
+
+			<view class="action-btn">
+				<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 {
+			getAreaList,
+			getBuildingList,
+			getUnitList,
+			getHousesList
+		} from '@/api/common'
+
+		export default {
+			components: {
+				SelectPicker
+			},
+			data() {
+
+				return {
+					number: '',
+					type: '',
+					open: false,
+					openDict: false,
+					selectList: [],
+					dictOptions: [],
+					imgArr: [],
+					XQValue: {},
+					XZQValue: {},
+					LDValue: {},
+					DYValue: {},
+					FJValue: {},
+					FSValue: {},
+					XQList: '',
+					LDList: '',
+					DYList: '',
+					FJList: '',
+					progress: 0, //上传图片进度百分比
+					loading: false
+
+
+				}
+			},
+
+			created() {
+				getDicts("district").then(response => {
+					this.dictOptions = response;
+				});
+
+
+			},
+			onLoad() {
+				uni.setNavigationBarTitle({
+					title: '旧改工程-室内'
+				})
+			},
+			methods: {
+				//判断是否选择
+				isEmpty(str) {
+
+					return (!str || 0 === str.length);
+
+				},
+				showPhoto(index) {
+					uni.previewImage({
+						current: index,
+						urls: this.imgArr,
+					})
+					console.log('sss')
+				},
+				remove(index) {
+					uni.showModal({
+						title: '提示',
+						content: '是否删除该图片或视频?',
+						success: (res) => {
+							if (res.confirm) {
+								this.imgArr.splice(index, 1)
+								console.log('this.imgarr', this.imgArr)
+								if (this.imgArr.length <= 0) {
+									this.photo = true;
+								}
+							}
+						}
+					})
+				},
+				chooseimage() {
+					console.log('图片')
+					let _this = this;
+					uni.chooseImage({
+						sizeType: ['album', 'camera'],
+						success(resp) {
+							console.log('res--uni.chooseMedia', resp);
+							resp.tempFiles.forEach((item, index) => {
+								const task = uni.uploadFile({
+									url: _this.$HTTP.webUrl + `/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;
+										if (![200, 201, 204].includes(res.statusCode)) {
+											// this.uploadError(index, data);
+											_this.$modal.msg('上传失败!')
+										} else {
+											if (_this.progress === 100) {
+												console.log('_this.progress', _this.progress)
+												console.log('data----', data)
+												console.log('res--', res)
+												_this.imgArr.push(data.data.url)
+												console.log('imgArr', _this.imgArr)
+												_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;
+									console.log('onProgressUpdate', res)
+									console.log('task.onProgressUpdate', _this.progress)
+									uni.showLoading({
+										title: '上传中'
+									})
+									if (_this.progress != 100) {
+										_this.loading = false
+										console.log('_this.loading false', _this.loading)
+									} else {
+										_this.loading = true
+										console.log('_this.loading true', _this.loading)
+									}
+								});
+
+							})
+
+						},
+					})
+				},
+				pickerShow(e) {
+
+
+					this.type = e; //赋值类型
+					if (e == 'xzq') { //行政区
+						this.openDict = true;
+						//this.selectList = this.dictOptions;
+
+					} else if (e == 'xq') { //小区
+						if (this.isEmpty(this.XZQValue.dictValue)) {
+							this.$modal.msg('请选择行政区')
+
+						} else {
+							this.open = true;
+							this.selectList = this.XQList;
+						}
+					} else if (e == 'ld') { //楼栋
+
+						if (this.isEmpty(this.XQValue.id)) {
+							this.$modal.msg('请选择小区')
+
+						} else {
+							this.open = true;
+							this.selectList = this.LDList;
+						}
+
+					} else if (e == 'dy') { //单元
+						if (this.isEmpty(this.LDValue.id)) {
+							this.$modal.msg('请选择楼栋')
+
+						} else {
+							this.open = true;
+							this.selectList = this.DYList;
+						}
+					} else if (e == 'fj') { //房间
+						if (this.isEmpty(this.DYValue.id)) {
+							this.$modal.msg('请选择单元')
+
+						} else {
+							this.open = true;
+							this.selectList = this.FJList;
+						}
+					}
+
+				},
+
+
+				switch2Change(e) {
+					console.log('switch2 发生 change 事件,携带值为', e.detail.value)
+				},
+				changeSelectDict(item, index) {
+					this.openDict = false;
+					this.XZQValue = item;
+
+					//根据行政区id获取小区数据
+					this.XQValue.name = ''; //重置楼栋数据
+					this.LDValue.name = ''; //重置楼栋数据
+					this.DYValue.name = ''; //重置单元数据
+					this.FJValue.name = ''; //重置房间数据
+					getAreaList(item.dictValue).then(res => {
+						this.XQList = res;
+					})
+
+				},
+				changeSelect(item, index) {
+					// this.index = index;
+					// this.address = item.communityName;
+					this.open = false;
+
+					if (this.type == 'xq') {
+						this.XQValue = item;
+						//根据小区id 获取楼栋数据
+						this.LDValue.name = ''; //重置楼栋数据
+						this.DYValue.name = ''; //重置单元数据
+						this.FJValue.name = ''; //重置房间数据
+						getBuildingList(item.id).then(res => {
+							this.LDList = res
+							// console.log("楼栋=", res)
+						})
+					} else if (this.type == 'ld') {
+						this.LDValue = item;
+						//根据楼栋ID 获取单元数据
+						this.DYValue.name = ''; //重置单元数据
+						this.FJValue.name = ''; //重置房间数据
+						getUnitList(item.id).then(res => {
+							this.DYList = res
+							// console.log("单元=", res)
+						})
+					} else if (this.type == 'dy') {
+						this.DYValue = item;
+						//根据单元数据 获取房间数据 
+						this.FJValue.name = ''; //重置房间数据
+						getHousesList(item.id).then(res => {
+							this.FJList = res
+							// console.log("房间=", res)
+						})
+					} else if (this.type == 'fj') {
+						this.FJValue = item;
+					}
+
+				},
+				//关闭弹窗
+				close(e) {
+					this.open = false
+				},
+				//关闭弹窗
+				closeDict(e) {
+					this.openDict = false
+				},
+				//提交数据
+				submit() {
+					if (this.isEmpty(this.XZQValue.dictValue)) {
+						this.$modal.msg("请选择行政区")
+					} else if (this.isEmpty(this.XQValue.id)) {
+						this.$modal.msg("请选择小区")
+					} else if (this.isEmpty(this.LDValue.id)) {
+						this.$modal.msg("请选择楼栋")
+					} else if (this.isEmpty(this.DYValue.id)) {
+						this.$modal.msg("请选择单元")
+					} else if (this.isEmpty(this.FJValue.id)) {
+						this.$modal.msg("请选择房间")
+					} else if (this.imgArr.length <= 0) {
+						this.$modal.msg('请上传照片')
+					} else if (this.loading == false) {
+						this.$modal.msg('照片未上传完毕,无法提交!')
+					}
+				}
+
 			}
-		},
-		methods: {
-			
 		}
-	}
-</script>
+	</script>
+
+	<style>
+		.container {
+			display: flex;
+			margin-left: 10px;
+			margin-top: 10px;
+			margin-right: 10px;
+			align-items: flex-start;
+			justify-content: space-between;
+		}
 
-<style>
+		.number {
+			display: flex;
+			/* 水平居中显示子元素 */
+			align-items: flex-start;
+			/* 垂直居中显示子元素 */
+			justify-content: space-between;
+			/* 左右间距等于间距大小 */
+			padding: 10px;
+			/* 设置padding以提高视觉效果 */
+		}
+
+		.text {
+			font-size: 16px;
+			color: #333;
+		}
+
+		.background {
+			border: 15px solid hsla(0, 0%, 100%, .5);
+			background: white;
+			background-clip: padding-box;
+			/*从padding开始往外面裁剪背景*/
 
-</style>
+		}
+
+		.btn {
+			margin-top: 40px;
+			margin-right: 20px;
+			margin-bottom: 20px;
+			margin-left: 20px;
+			height: 45px;
+		}
+	</style>

BIN
static/images/chooseimg.png


BIN
static/images/icon_right.png