|
@@ -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>
|