1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021 |
- <template>
- <scroll-view>
- <view class="background">
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <view>
- 行政区
- </view>
- <view v-if="this.isEmpty(this.XZQValue.dictValue)" @click="pickerShow('xzq',0)">
- <span style="color: darkgray;">请选择行政区</span>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </view>
- <view v-else class="uni-list-cell-db" @click="pickerShow('xzq',0)">
- <span style="color: black;">{{XZQValue.dictLabel}}</span>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <view>
- 小区
- </view>
- <view v-if="this.isEmpty(this.XQValue.id)" class="uni-list-cell-db" @click="pickerShow('xq',0)">
- <span style="color: darkgray;">请选择小区</span>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </view>
- <view v-else class="uni-list-cell-db" @click="pickerShow('xq',0)">
- <span style="color: black;">{{XQValue.name}}</span>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </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" @click="pickerShow('ld',0)">
- <span style="color: darkgray;">请选择楼栋</span>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </view>
- <view v-else class="uni-list-cell-db" @click="pickerShow('ld',0)">
- <span style="color: black;">{{LDValue.name}}</span>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </view>
- </view>
- </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>
- <view class="uni-list">
- <view
- style="font-size: 16px;margin-left: 10px;margin-top: 10px;display: flex; justify-content: space-between;margin-bottom: 10px;">
- {{objValue.enginClassValue}}
- <span
- style="color: blue;font-size: 14px; display: flex;justify-content:flex-end; margin-right: 10px;"
- @click="history">历史</span>
- </view>
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <view>
- 施工时间
- </view>
- <view @click="openDatetimePicker('sg')">
- <span style="color: black;">{{time}}</span>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </view>
- </view>
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <view class="uni-common-mt" style="width: 100%;">
- <text class="uni-title uni-common-pl">施工内容</text>
- <view style="width: 100%;box-sizing: border-box;">
- <textarea class="textarea" placeholder="请输入施工内容" maxlength="255"
- placeholder-style="padding: 10rpx;"
- style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
- auto-height v-model="projectContent"></textarea>
- </view>
- </view>
- </view>
- <view v-for="(a,index) in czggslList" :key="index" class="num-style">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <view>
- 材质
- </view>
- <view class="uni-list-cell-db" @click="pickerShow('cz',index)">
- <span style="color: black;">{{a.cz.id==''?'请选择材质':a.cz.name}}</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" @click="pickerShow('gg',index)">
- <span style="color: black;">{{a.gg.id==''?'请选择规格':a.gg.name}}</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>
- <input class="uni-input" type="number" v-model="a.sl" placeholder="请填写数量" maxlength="11"
- style="margin-left: 10px;text-align: right;"></input>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </view> -->
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>米 数</text>
- <!-- style="margin-left: 10px;text-align: right;" -->
- <view style="display: flex; justify-content: right; width: 70%;">
- <input class="uni-input" type="number" v-model="a.sl.inputIntegerNumberValue" 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" v-model="a.sl.inputDecimalNumberValue" maxlength="1"
- style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
- </view>
- </view>
- <button v-if="index!=0" @click="this.czggslList.splice(index,1)" class="sc-btn">删除</button>
- </view>
- <button @click="this.czggslList.push({cz:{id: '',name: ''},gg:{id: '',name: ''},sl: {
- inputIntegerNumberValue: '',
- inputDecimalNumberValue: ''
- }})" class="tj-btn">添加</button>
- </view>
- <view class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
- <view class="container" style="color: #b2b2b2;">*请上传管上皮深度测量照片</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('gspsdcl')"
- v-show="reviewStatus!='1'"></image>
- <view v-for="(item,index) in imgGuanArr" :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,'gspsdcl')">
- </image>
- </view>
- <view v-else>
- <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
- </view>
- <view @click="remove(index,'gspsdcl')"
- 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 class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
- <view class="container" style="color: #b2b2b2;">*请上传管沟远景照片</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('ggyj')"
- v-show="reviewStatus!='1'"></image>
- <view v-for="(item,index) in imgArr" :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,'ggyj')">
- </image>
- </view>
- <view v-else>
- <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
- </view>
- <view @click="remove(index,'ggyj')"
- 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 class="align-items" style="margin-top: 20px;margin-bottom: 20px;">
- <view class="container" style="color: #b2b2b2;">*请上传视频</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('video')"
- v-show="reviewStatus!='1'"></image>
- <view v-for="(item,index) in videoArr" :key="index" style="position: relative;">
- <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
- <view @click="remove(index,'video')"
- 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>
- </view>
- <view class="action-btn" v-show="reviewStatus!='1'">
- <button @click="submit" class="btn cu-btn block bg-blue lg round">确认上传</button>
- </view>
- <bottom-sheet ref="refShare" :data="historyList" :TitleType="objValue.enginClassValue"></bottom-sheet>
- <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
- :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
- </scroll-view>
- </template>
- <script>
- import SelectPicker from '../../../components/selectPicker/select_picker.vue'
- import bottomSheet from '../../../components/bottomSheet/bottomSheetMore.vue'
- import {
- getDicts
- } from "@/api/system/dict/data";
- import {
- getAreaList,
- getBuildingList,
- addTearOldPipe,
- getEnginMaterialQualityList,
- getEnginSpecificationsList,
- getRoomProjectList,
- getRoomProjectId,
- } from '@/api/common'
- import {
- getToken
- } from '../../../utils/auth';
- export default {
- components: {
- SelectPicker,
- bottomSheet,
- },
- data() {
- return {
- headers: {
- Authorization: "Bearer " + getToken()
- },
- zEngineeringMaterialBo: [], //给后台传的值 用料列表
- czggslList: [{
- cz: {
- id: '',
- name: ''
- },
- gg: {
- id: '',
- name: ''
- },
- sl: {
- inputIntegerNumberValue: '',
- inputDecimalNumberValue: ''
- }
- }, ],
- type: '',
- reviewStatus: '', //是否可以点击
- open: false,
- objValue: '', //上一页面传过来的值 新增接口用
- openDict: false,
- selectList: [],
- dictOptions: [],
- imgArr: [],
- imgGuanArr: [],
- videoArr: [],
- XQValue: {},
- XZQValue: {},
- SelectIndex: '', //选择的索引值
- projectValue: {
- 'dictValue': '0'
- },
- LevelValue: {},
- isOkValue: '', //分段打压是否合格
- isOkLabel: '', //分段打压是否合格label
- LDValue: {},
- time: '', //施工时间
- timeType: '', //时间类型
- BackfillingTime: '', //回填时间
- showTime: false,
- specificationValue: {}, //规格
- projectContent: '', //施工内容
- materialValue: {}, //材质
- brandValue: {}, //品牌
- doorValue: {}, //上门类型
- SelfClosValve: {}, //自闭阀类型
- materialList: '', //材质list
- XQList: '',
- LDList: '',
- progress: 0, //上传图片进度百分比
- loading: false,
- inputNumberValue: '',
- title: '',
- historyList: {} //历史数据
- }
- },
- created() {
- this.time = this.traversalTime(new Date().getTime()) //在data里定义变量-nowTime
- },
- onLoad(options) {
- if ('params' in options) {
- this.objValue = JSON.parse(decodeURIComponent(options.params));
- if (this.objValue.enginType == `old_renovation`) {
- this.title = '旧改工程-庭院'
- } else if (this.objValue.enginType == `new_built`) {
- this.title = '新建工程-庭院'
- }
- uni.setNavigationBarTitle({
- title: this.title
- })
- }
- },
- methods: {
- // 打开picker
- openDatetimePicker(type) {
- this.timeType = type;
- this.$refs.myPicker.show();
- },
- // 关闭picker
- closeDatetimePicker() {
- this.$refs.myPicker.hide();
- },
- handleSubmit(e) {
- if (this.timeType == 'ht') {
- this.BackfillingTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
- } else {
- this.time = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
- }
- },
- //获取当前时间
- traversalTime(timestamp) {
- //timestamp(时间戳)是整数,否则要parseInt转换
- let time = new Date(timestamp);
- let y = time.getFullYear();
- let m = time.getMonth() + 1;
- let d = time.getDate();
- let h = time.getHours();
- let mm = time.getMinutes();
- let s = time.getSeconds();
- return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(h) + ':' + this.addTimes(
- mm) + ':' + this.addTimes(s);
- },
- addTimes(m) {
- return m < 10 ? '0' + m : m
- },
- //判断是否选择
- isEmpty(str) {
- return (!str || 0 === str.length);
- },
- // 显示历史弹窗
- handleShowSheet() {
- this.shareState = true;
- },
- // 隐藏历史弹窗
- handleHiddenShare() {
- this.shareState = false;
- },
- showPhoto(index, type) {
- let typeArr = [];
- if (type == 'gspsdcl') {
- typeArr = this.imgGuanArr;
- } else {
- typeArr = this.imgArr;
- }
- uni.previewImage({
- current: index,
- urls: typeArr,
- })
- },
- remove(index, type) {
- let content = '';
- if (type == 'video') {
- content = '是否删除该视频?'
- } else {
- content = '是否删除该图片?'
- }
- uni.showModal({
- title: '提示',
- content: content,
- success: (res) => {
- if (res.confirm) {
- if (type == 'video') {
- this.videoArr.splice(index, 1)
- } else if (type == 'gspsdcl') {
- this.imgGuanArr.splice(index, 1)
- } else if (type == 'ggyj') {
- this.imgArr.splice(index, 1)
- }
- }
- }
- })
- },
- choose(e) {
- let _this = this;
- if (e == 'video') {
- this.choosevideo()
- } else {
- this.chooseimage(e)
- }
- },
- chooseimage(e) {
- 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 = JSON.parse(res.data);
- if (![200].includes(data.code)) {
- _this.$modal.msg(data.msg)
- } else {
- if (_this.progress === 100) {
- if (e == 'ggyj') {
- _this.imgArr.push(data.data.url)
- } else if (e == 'gspsdcl') {
- _this.imgGuanArr.push(data.data.url)
- }
- _this.$modal.msg('上传成功!')
- }
- }
- },
- 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.videoArr.push(data.data.url)
- _this.$modal.msg('上传成功!')
- }
- }
- },
- 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
- }
- });
- },
- })
- },
- pickerShow(e, index) {
- this.SelectIndex = index;
- this.type = e; //赋值类型
- if (e == 'cz') { //材质
- this.open = true;
- getEnginMaterialQualityList("民用工程", this.objValue.enginType, this.objValue.enginClassification).then(
- response => {
- this.selectList = response.data;
- });
- } else if (e == 'gg') { //规格
- if (this.isEmpty(this.czggslList[index].cz.id)) {
- this.$modal.msg('请选择材质')
- // this.czggslList[index].cz = this.materialValue.id
- } else {
- this.open = true;
- this.selectList = this.materialList;
- }
- } else if (e == 'gczq') { //工程周期
- this.openDict = true;
- getDicts("engin_cycle").then(response => {
- this.dictOptions = response.data;
- });
- } else if (e == 'xzq') { //行政区
- if (this.isEmpty(this.projectValue.dictValue)) {
- this.$modal.msg('请选择工程周期')
- } else {
- this.openDict = true;
- getDicts("district").then(response => {
- this.dictOptions = response.data;
- });
- }
- //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;
- }
- }
- },
- changeSelectDict(item, index) {
- this.openDict = false;
- if (this.type == 'isok') {
- this.isOkValue = item
- } else if (this.type == 'gczq') {
- this.projectValue = item
- if (!this.isEmpty(this.XQValue.id)) {
- //房间选完 判断 工程周期 工程周期切换
- this.getStatus();
- }
- } else if (this.type == 'xzq') {
- this.XZQValue = item;
- //根据行政区id获取小区数据
- this.XQValue = ''; //重置小区数据
- this.LDValue = ''; //重置楼栋数据
- getAreaList(item.dictValue).then(res => {
- this.XQList = res.data;
- })
- }
- },
- changeSelect(item, index) {
- this.open = false;
- if (this.type == 'cz') {
- this.materialValue = item;
- this.specificationValue = ''; //重置规格
- this.czggslList[this.SelectIndex].gg.id = ''
- this.czggslList[this.SelectIndex].gg.name = ''
- //根据材质ID 获取规格数据
- getEnginSpecificationsList(item.id).then(res => {
- this.materialList = res.data
- this.czggslList[this.SelectIndex].cz.id = this.materialValue.id
- this.czggslList[this.SelectIndex].cz.name = this.materialValue.name
- })
- } else if (this.type == 'gg') {
- this.specificationValue = item;
- this.czggslList[this.SelectIndex].gg.id = this.specificationValue.id
- this.czggslList[this.SelectIndex].gg.name = this.specificationValue.name
- } else if (this.type == 'xq') {
- this.XQValue = item;
- if (!this.isEmpty(this.projectValue.dictValue)) {
- //小区选完 判断 工程周期
- this.getStatus();
- }
- //根据小区id 获取楼栋数据
- this.LDValue = ''; //重置楼栋数据
- this.DYValue = ''; //重置单元数据
- this.FJValue = ''; //重置房间数据
- getBuildingList(item.id).then(res => {
- this.LDList = res.data
- })
- } else if (this.type == 'ld') {
- this.LDValue = item;
- if (!this.isEmpty(this.projectValue.dictValue)) {
- //楼栋选完 判断 工程周期
- this.getStatus();
- }
- }
- },
- //关闭弹窗
- close(e) {
- this.open = false
- },
- //关闭弹窗
- closeDict(e) {
- this.openDict = false
- },
- getStatus() {
- let unitId = '';
- let houseId = '';
- let buildingId = '';
- if (this.isEmpty(this.LDValue.id)) {
- buildingId = '';
- } else {
- buildingId = this.LDValue.id
- }
- let param = {
- areaId: this.XQValue.id, // 小区id
- buildingId: buildingId, // 楼宇id
- unitId: unitId,
- houseId: houseId, //传空
- enginCycle: this.projectValue.dictValue, // 工程周期
- enginType: this.objValue.enginType, //写死 上一页面传过来的
- enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
- }
- getRoomProjectId(param).then(res => {
- if (res.code == '200') {
- if (res.data != null && res.data.zEngineeringNodeBoList != null) {
- res.data.zEngineeringNodeBoList.forEach((item, index) => {
- if (this.objValue.enginClassValue == item.type) {
- this.reviewStatus = item.reviewStatus;
- if (item.reviewStatus == '1')
- this.$modal.msg('当前工程已结束')
- }
- })
- } else {
- this.reviewStatus = '' //置空
- }
- } else {
- this.$modal.msg(res.msg)
- this.reviewStatus = '' //置空
- }
- })
- },
- //提交数据
- submit() {
- if (this.isEmpty(this.projectValue.dictValue)) {
- this.$modal.msg("请选择工程周期")
- return
- }
- if (this.isEmpty(this.XZQValue.dictValue)) {
- this.$modal.msg("请选择行政区")
- return
- }
- if (this.isEmpty(this.XQValue.id)) {
- this.$modal.msg("请选择小区")
- return
- }
- // else if (this.isEmpty(this.LDValue.id)) {
- // this.$modal.msg("请选择楼栋")
- // }
- try {
- this.czggslList.forEach((list) => {
- if (this.isEmpty(list.cz.id)) {
- this.$modal.msg('材质不能为空')
- throw new Error('End Loop')
- }
- if (this.isEmpty(list.gg.id)) {
- this.$modal.msg('规格不能为空')
- throw new Error('End Loop')
- }
- // if (this.isEmpty(list.sl)) {
- // this.$modal.msg('数量不能为空')
- // throw new Error('End Loop')
- // }
- if (this.isEmpty(list.sl.inputIntegerNumberValue)) {
- this.$modal.msg("请输入米数")
- throw new Error('End Loop')
- }
- })
- } catch (e) {
- if (e.message === 'End Loop') throw e
- }
- this.zEngineeringMaterialBo = [];
- this.czggslList.forEach((list) => {
- this.zEngineeringMaterialBo.push({
- materialQuality: list.cz.id,
- specifications: list.gg.id,
- number: list.sl.inputIntegerNumberValue + (list.sl.inputDecimalNumberValue == '' ?
- '' : "." + list.sl.inputDecimalNumberValue)
- })
- })
- if (this.imgGuanArr.length <= 0) {
- this.$modal.msg('请上传管上皮深度测量照片')
- return
- }
- if (this.imgArr.length <= 0) {
- this.$modal.msg('请上传管沟远景照片')
- return
- }
- if (this.videoArr.length <= 0) {
- this.$modal.msg('请上传视频')
- return
- }
- if (this.loading == false) {
- this.$modal.msg('照片或视频未上传完毕,无法提交!')
- return
- }
- //提交
- this.onsubmit();
- },
- onsubmit() {
- let unitId = '';
- let houseId = '';
- let buildingId = '';
- if (this.isEmpty(this.LDValue.id)) {
- buildingId = '';
- } else {
- buildingId = this.LDValue.id
- }
- //提交
- let param = {
- district: this.XZQValue.dictValue,
- areaId: this.XQValue.id,
- buildingId: buildingId, //不必传 如果没有传 ' '
- unitId: unitId,
- houseId: houseId, //传空
- enginType: this.objValue.enginType, //写死 上一页面传过来的
- enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
- enginCycle: this.projectValue.dictValue, //工程周期
- zEngineeringNodeBo: {
- type: this.objValue.enginClassValue, //写死 上一页面传过来的 (拆旧管等 字典值)
- zEngineeringInfoBo: {
- ductalEpithelium: this.imgGuanArr, //照片集合
- trenchProspect: this.imgArr,
- video: this.videoArr,
- constructTime: this.time, //施工时间
- remark: this.projectContent, //施工内容
- zEngineeringMaterialBo: this.zEngineeringMaterialBo
- }
- }
- }
- uni.showLoading()
- addTearOldPipe(param).then(res => {
- if (res.code == '200') {
- uni.hideLoading()
- uni.showToast({
- title: res.msg,
- icon: 'none',
- //显示持续时间为 3秒
- duration: 2000
- });
- setTimeout(function() {
- uni.navigateBack();
- }, 1000)
- }
- })
- },
- history() {
- if (this.isEmpty(this.projectValue.dictValue)) {
- this.$modal.msg("请选择工程周期")
- return
- }
- if (this.isEmpty(this.XZQValue.dictValue)) {
- this.$modal.msg("请选择行政区")
- return
- }
- if (this.isEmpty(this.XQValue.id)) {
- this.$modal.msg("请选择小区")
- return
- }
- let unitId = '';
- let houseId = '';
- let buildingId = '';
- if (this.isEmpty(this.LDValue.id)) {
- buildingId = '';
- } else {
- buildingId = this.LDValue.id
- }
- let param = {
- areaId: this.XQValue.id, // 小区id
- buildingId: buildingId, // 楼宇id
- enginCycle: this.projectValue.dictValue, // 工程周期
- unitId: unitId,
- houseId: houseId, //传空
- enginType: this.objValue.enginType, //写死 上一页面传过来的
- enginClassification: this.objValue.enginClassification, //写死 上一页面传过来的 //室内 - 庭院 - 架空
- }
- getRoomProjectId(param).then(res => {
- if (res.code == '200') {
- if (res.data != null) {
- getRoomProjectList(res.data.id, this.objValue.enginClassValue).then(
- res => {
- this.historyList = res.data
- if (res.data.zEngineeringNodeBo != null) {
- this.showHistoryList();
- } else {
- this.$modal.msg("暂无历史信息")
- }
- })
- } else {
- this.$modal.msg("暂无工程信息")
- }
- } else {
- this.$modal.msg(res.msg)
- }
- })
- },
- showHistoryList() {
- this.$refs.refShare.handleShowShare();
- }
- }
- }
- </script>
- <style lang="scss">
- .container {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 10px;
- position: relative;
- }
- .uni-list {
- border: 1xp solid #eee;
- }
- .to-right-icon {
- width: 15px;
- height: 15px;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- }
- .text {
- font-size: 16px;
- color: #333;
- }
- .background {
- // border: 15px solid hsla(0, 0%, 100%, .5);
- background: white;
- background-clip: padding-box;
- padding: 20rpx;
- border-radius: 20rpx;
- margin: 20rpx;
- /*从padding开始往外面裁剪背景*/
- }
- .btn {
- width: 715rpx;
- height: 69rpx;
- background: #79A4F0;
- border-radius: 6rpx;
- font-size: 25rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 69rpx;
- margin-top: 40rpx;
- margin-bottom: 100rpx;
- }
- .number {
- display: flex;
- /* 水平居中显示子元素 */
- align-items: flex-start;
- /* 垂直居中显示子元素 */
- justify-content: space-between;
- /* 左右间距等于间距大小 */
- padding: 10px;
- /* 设置padding以提高视觉效果 */
- }
- .textarea {
- margin-top: 10upx;
- width: 100%;
- border: 1rpx solid red;
- min-height: 100upx;
- line-height: 20px;
- }
- </style>
|