1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081 |
- <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.projectObj.enginName)" style="margin-top: 10;"
- @click="pickerShow('name')">
- <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('name')">
- <span style="color: black;">{{projectObj.enginName}}</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 style="margin-top: 10;">
- <span style="color: black;">{{projectObj.enginAddre}}</span>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="container">
- <view>
- 作业基本信息
- </view>
- <view style="margin-top: 10;">
- <span style="color: black;">{{projectObj.basicInformation}}</span>
- </view>
- </view>
- </view>
- </view>
- <view class="background">
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <view>
- 工程时间
- </view>
- <view v-if="isEmpty(this.projectTime)" @click="openDatetimePicker">
- <span style="color: darkgray;">请选择工程时间</span>
- <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
- </view>
- <view v-else @click="openDatetimePicker">
- <span style="color: black;">{{projectTime}}</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;">
- <text>管径</text>
- <input class="uni-input" type="digit" v-model="projectObj.pipeDiameter" placeholder="请输入管径"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>管材</text>
- <input class="uni-input" type="text" v-model="projectObj.tubularProduct" placeholder="请输入管材"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>是否存在套管</text>
- <view>
- <span style="color: black;">{{bushingText}}</span>
- <switch v-if="isBushing" checked style="transform: scale(0.6,0.6);"
- @change="switchChangePipe" />
- <switch v-else style="transform: scale(0.6,0.6);" @change="switchChangePipe" />
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>管道压力</text>
- <input class="uni-input" type="digit" v-model="projectObj.pipePressure" placeholder="请输入管道压力"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>气源方向</text>
- <input class="uni-input" type="text" v-model="projectObj.gasSourceDirection" placeholder="请输入气源方向"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>作业位置</text>
- <input class="uni-input" type="text" v-model="projectObj.taskPosition" placeholder="请输入作业位置"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>作业相关阀门位置</text>
- <input class="uni-input" type="text" v-model="projectObj.valvePosition" placeholder="请输入作业相关阀门位置"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>压力报告</text>
- <input class="uni-input" type="text" v-model="projectObj.stressReport" placeholder="请输入压力报告"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>监理旁站记录</text>
- <input class="uni-input" type="text" v-model="projectObj.supervisionRecord" placeholder="请输入监理旁站记录"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>工作联系单</text>
- <input class="uni-input" type="text" v-model="projectObj.workContactForm" placeholder="请输入工作联系单"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>巡线确认单</text>
- <input class="uni-input" type="text" v-model="projectObj.linePatrolConfirmationForm"
- placeholder="请输入巡线确认单" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>危险作业坑大小(长,宽,深)</text>
- <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsLong" placeholder="请输入长"
- maxlength="9"
- style="margin-left: 10px;text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
- <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsWide" placeholder="请输入宽"
- maxlength="9"
- style="margin-left: 10px;text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
- <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsDeep" placeholder="请输入深"
- maxlength="9"
- style="margin-left: 10px;text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>是否需要支护</text>
- <view>
- <span style="color: black;">{{needSupportText}}</span>
- <switch v-if="isNeedSupport" checked style="transform: scale(0.6,0.6);"
- @change="switchChangeSupport" />
- <switch v-else style="transform: scale(0.6,0.6);" @change="switchChangeSupport" />
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>作业坑内其他管道情况</text>
- <input class="uni-input" type="text" v-model="projectObj.otherPipelineConditionsWorkPit"
- placeholder="请输入作业坑内其他管道情况" maxlength="100"
- style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>现场负责人</text>
- <input class="uni-input" type="text" v-model="projectObj.siteHead" placeholder="请输入现场负责人"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>现场负责人联系方式</text>
- <input class="uni-input" type="number" v-model="projectObj.siteHeadPhone" placeholder="请输入现场负责人联系方式"
- maxlength="11" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>作业人员信息</text>
- <input class="uni-input" type="text" v-model="projectObj.operatorInformation"
- placeholder="请输入作业人员信息" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>检口</text>
- <input class="uni-input" type="text" v-model="projectObj.inspectionPort" placeholder="请输入检口"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>管道刷油</text>
- <input class="uni-input" type="text" v-model="projectObj.pipelinePainting" placeholder="请输入管道刷油"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>管道防腐</text>
- <input class="uni-input" type="text" v-model="projectObj.pipelineCorrosionProtection"
- placeholder="请输入管道防腐" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>管道支护</text>
- <input class="uni-input" type="text" v-model="projectObj.pipelineSupport" placeholder="请输入管道支护"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>砌筑阀门井</text>
- <input class="uni-input" type="text" v-model="projectObj.masonryValveWell" placeholder="请输入砌筑阀门井"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>保护井</text>
- <input class="uni-input" type="text" v-model="projectObj.protectionWell" placeholder="请输入保护井"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>管件保护井砌筑</text>
- <input class="uni-input" type="text" v-model="projectObj.pipeProtectionWelMasonry"
- placeholder="请输入管件保护井砌筑" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>回填</text>
- <input class="uni-input" type="text" v-model="projectObj.backfill" placeholder="请输入回填"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>夯实</text>
- <input class="uni-input" type="text" v-model="projectObj.tamp" placeholder="请输入夯实" maxlength="100"
- style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>平整场地</text>
- <input class="uni-input" type="text" v-model="projectObj.levelingTheSite" placeholder="请输入平整场地"
- maxlength="100" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container" style="border-bottom: 1px solid #f8f8f8;">
- <text>备注</text>
- <input class="uni-input" type="text" v-model="projectObj.remark" placeholder="请输入备注" maxlength="100"
- style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="align-items" style="margin-bottom: 20px;">
- <view class="container" style="color: #b2b2b2;">*请上传文件</view>
- <view 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"></image>
- <view v-for="(item,index) in fileArr" :key="index" style="position: relative;">
- <view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
- <image
- v-if="item.picUrl.substring(item.picUrl.length - 3) == 'png' || item.picUrl.substring(item.picUrl.length - 3) == 'jpg' || item.picUrl.substring(item.picUrl.length - 4) == 'jpeg' "
- :src="item.picUrl" @click="this.showPhoto(item.picUrl,fileArr)"
- style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
- </image>
- <video v-else-if="item.picUrl.substring(item.picUrl.length - 3) == 'mp4'"
- :src="item.picUrl" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
- </video>
- <text v-else @click="chooseModel(item.picUrl,item.fileName)">
- {{item.fileName}}
- </text>
- </view>
- <view v-if="isShowRemoveFile(item)" @click="removeFile(index)"
- style="position: absolute; top: 0; right: 0rpx; border-radius: 50%;">
- <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
- </image>
- </view>
- </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="rows" @change="projectListSelect" v-if="open" @close="close" titleKey="name"
- subtitleKey="id" v-model="name"></SelectPicker>
- <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
- :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
- <!-- 下载提示页面 -->
- <mypopup :show="show_loding" :popupText="popupText" :titleText="titleText" :cancelText="cancelText"
- :confirmText="confirmText" @close="cancel_loding" @confirm="confirm_loding">
- </mypopup>
- </scroll-view>
- </template>
- <script>
- import SelectPicker from '../../components/selectPicker/select_picker.vue'
- import {
- getToken
- } from '../../utils/auth';
- import {
- getDangerousWorkProjectList,
- getDangerousWorkProjectDetails,
- updateDangerousWorkProject
- } from '@/api/common'
- export default {
- components: {
- SelectPicker
- },
- data() {
- return {
- headers: {
- Authorization: "Bearer " + getToken()
- },
- isBushing: false,
- bushingText: "否",
- isNeedSupport: false,
- needSupportText: "否",
- file: [], // 附件
- pics: [], // 附件返回
- rows: [],
- open: false,
- projectObj: {},
- currentTime: "",
- fileArr: [],
- projectTime: "",
- imgList: [],
- popupText: '', //对话框内容
- titleText: '',
- cancelText: '',
- confirmText: '',
- show_loding: false,
- fileUrl: '', //点击的文件地址
- fileName: '', //点击的文件名称
- }
- },
- created() {
- this.currentTime = this.traversalTime(new Date().getTime()); //在data里定义变量-nowTime
- },
- methods: {
- isEmpty(str) {
- return (!str || 0 === str.length);
- },
- chooseModel(url, name) {
- this.cancelText = '复制';
- this.confirmText = "下载";
- this.titleText = "温馨提示"
- this.popupText = "下载或者复制链接";
- this.show_loding = true;
- this.fileName = name;
- this.fileUrl = url; //文件名称和下载地址赋值
- },
- //取消按钮
- cancel_loding() {
- let _this = this;
- _this.show_loding = false;
- if (!_this.isEmpty(_this.fileUrl)) {
- uni.setClipboardData({
- data: _this.fileUrl,
- success() {
- uni.showToast({
- title: '已复制' + _this.fileName + '地址成功 请在浏览器打开',
- icon: 'none'
- });
- },
- fail(e) {
- uni.showToast({
- title: '复制失败',
- icon: 'none'
- });
- }
- });
- }
- },
- //确定按钮
- confirm_loding() {
- this.show_loding = false;
- this.download(this.fileUrl, this.fileName);
- },
- getDownLoadFilePath() {
- let cachePath = `${uni.env.USER_DATA_PATH}/downloads`
- let fm = uni.getFileSystemManager()
- try {
- // 访问成功则存在
- fm.accessSync(cachePath)
- } catch (error) {
- // 不存在则新建
- fm.mkdirSync(cachePath, true)
- }
- return cachePath
- },
- download(url, name) {
- let savePath = this.getDownLoadFilePath();
- //var savePath = uni.env.USER_DATA_PATH + '/savePath'
- uni.downloadFile({
- url: url,
- success: response => {
- if (response.statusCode === 200) {
- uni.getFileSystemManager().saveFile({
- tempFilePath: response.tempFilePath,
- filePath: `${savePath}/${name}`,
- success: (resData) => {
- uni.showToast({
- title: '下载成功'
- })
- },
- fail: error => {}
- })
- }
- }
- })
- },
- showPhoto(currentUrl, arr) {
- let newArr = [];
- for (let i = 0; i < arr.length; i++) {
- if (arr[i].picUrl.substring(arr[i].picUrl.length - 3) == 'png' || arr[i].picUrl.substring(arr[i].picUrl.length - 3) == 'jpg' ||
- arr[i].picUrl.substring(arr[i].picUrl.length - 4) ==
- 'jpeg') {
- newArr.push(arr[i].picUrl);
- }
- }
- let mIndex = newArr.indexOf(currentUrl);
- uni.previewImage({
- current: mIndex,
- urls: newArr,
- })
- },
- pickerShow(e) {
- if (e == 'name') {
- this.open = true;
- let param = {};
- getDangerousWorkProjectList(param).then(res => {
- this.rows = res.data;
- })
- }
- },
- changeSelect(e) {
- },
- close() {
- this.open = false;
- },
- projectListSelect(item, index) {
- this.open = false;
- getDangerousWorkProjectDetails(item.id).then(res => {
- this.projectObj = res.data;
- this.projectTime = this.projectObj.enginTime;
- // if (this.isEmpty(this.projectTime)) {
- // this.projectTime = this.currentTime;
- // this.projectObj.enginTime = this.currentTime;
- // }
- this.isNeedSupport = this.projectObj.needSupport == "1";
- if (this.isNeedSupport) {
- this.needSupportText = "是";
- this.projectObj.needSupport = "1";
- } else {
- this.needSupportText = "否";
- this.projectObj.needSupport = "0";
- }
- this.isBushing = this.projectObj.casingPresent == "1";
- if (this.isBushing) {
- this.bushingText = "是";
- this.projectObj.casingPresent = "1";
- } else {
- this.bushingText = "否";
- this.projectObj.casingPresent = "0";
- }
- this.fileArr = this.projectObj.pics;
- // for (let i = 0; i < this.fileArr.length; i++) {
- // if (this.fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 3) == 'png' || this
- // .fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 3) == 'jpg' ||
- // this.fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 4) ==
- // 'jpeg') {
- // this.imgList.push(this.fileArr[i].picUrl);
- // }
- // }
- })
- },
- switchChangePipe(e) {
- this.isBushing = e.detail.value;
- if (this.isBushing) {
- this.projectObj.casingPresent = "1";
- this.bushingText = "是";
- } else {
- this.projectObj.casingPresent = "0";
- this.bushingText = "否";
- }
- },
- switchChangeSupport(e) {
- this.isNeedSupport = e.detail.value;
- if (this.isNeedSupport) {
- this.projectObj.needSupport = "1";
- this.needSupportText = "是";
- } else {
- this.projectObj.needSupport = "0";
- this.needSupportText = "否";
- }
- },
- choose() {
- 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 = JSON.parse(res.data);
- if (![200].includes(data.code)) {
- _this.$modal.msg(data.msg)
- } else {
- if (_this.progress === 100) {
- _this.fileArr.push({
- 'fileName': data.data
- .fileName,
- 'picUrl': data
- .data.url,
- });
- _this.imgList.push(data.data.url);
- _this.$modal.msg('上传成功!')
- _this.photo = false;
- }
- }
- },
- fail: e => {
- _this.$modal.msg('上传失败!')
- },
- 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.fileArr.push({
- 'fileName': data.data
- .fileName,
- 'picUrl': 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
- }
- });
- },
- })
- },
- isShowRemoveFile(item) {
- var isShow = item.createBy==undefined||item.createBy == this.$user.state.name;
- return isShow;
- },
- removeFile(index) {
- uni.showModal({
- title: '提示',
- content: '是否删除该文件?',
- success: (res) => {
- if (res.confirm) {
- this.fileArr.splice(index, 1)
- }
- }
- })
- },
- submit() {
- if (this.isEmpty(this.projectObj.pipeDiameter)) {
- this.$modal.msg('请输入管径')
- return;
- }
- if (this.isEmpty(this.projectObj.tubularProduct)) {
- this.$modal.msg('请输入管材')
- return;
- }
- if (this.isEmpty(this.projectObj.pipePressure)) {
- this.$modal.msg('请输入管道压力')
- return;
- }
- if (this.isEmpty(this.projectObj.gasSourceDirection)) {
- this.$modal.msg('请输入气源方向')
- return;
- }
- if (this.isEmpty(this.projectObj.taskPosition)) {
- this.$modal.msg('请输入作业位置')
- return;
- }
- if (this.isEmpty(this.projectObj.valvePosition)) {
- this.$modal.msg('请输入作业相关阀门位置')
- return;
- }
- if (this.isEmpty(this.projectObj.stressReport)) {
- this.$modal.msg('请输入压力报告')
- return;
- }
- if (this.isEmpty(this.projectObj.supervisionRecord)) {
- this.$modal.msg('请输入监理旁站记录')
- return;
- }
- if (this.isEmpty(this.projectObj.workContactForm)) {
- this.$modal.msg('请输入工作联系单')
- return;
- }
- if (this.isEmpty(this.projectObj.linePatrolConfirmationForm)) {
- this.$modal.msg('请输入巡线确认单')
- return;
- }
- if (this.isEmpty(this.projectObj.hazardousWorkPitsLong)) {
- this.$modal.msg('请输入危险作业坑长度')
- return;
- }
- if (this.isEmpty(this.projectObj.hazardousWorkPitsWide)) {
- this.$modal.msg('请输入危险作业坑宽度')
- return;
- }
- if (this.isEmpty(this.projectObj.hazardousWorkPitsDeep)) {
- this.$modal.msg('请输入危险作业坑深度')
- return;
- }
- if (this.isEmpty(this.projectObj.otherPipelineConditionsWorkPit)) {
- this.$modal.msg('请输入作业坑内其他管道情况')
- return;
- }
- if (this.isEmpty(this.projectObj.siteHead)) {
- this.$modal.msg('请输入现场负责人')
- return;
- }
- if (this.isEmpty(this.projectObj.siteHeadPhone)) {
- this.$modal.msg('请输入现场负责人联系方式')
- return;
- } else {
- if (!this.$validation.mobile(this.projectObj.siteHeadPhone)) {
- this.$modal.msg('请输入正确的联系方式');
- return;
- }
- }
- if (this.isEmpty(this.projectObj.operatorInformation)) {
- this.$modal.msg('请输入作业人员信息')
- return;
- }
- if (this.isEmpty(this.projectObj.inspectionPort)) {
- this.$modal.msg('请输入检口')
- return;
- }
- if (this.isEmpty(this.projectObj.pipelinePainting)) {
- this.$modal.msg('请输入管道刷油')
- return;
- }
- if (this.isEmpty(this.projectObj.pipelineCorrosionProtection)) {
- this.$modal.msg('请输入管道防腐')
- return;
- }
- if (this.isEmpty(this.projectObj.pipelineSupport)) {
- this.$modal.msg('请输入管道支护')
- return;
- }
- if (this.isEmpty(this.projectObj.masonryValveWell)) {
- this.$modal.msg('请输入砌筑阀门井')
- return;
- }
- if (this.isEmpty(this.projectObj.protectionWell)) {
- this.$modal.msg('请输入保护井')
- return;
- }
- if (this.isEmpty(this.projectObj.pipeProtectionWelMasonry)) {
- this.$modal.msg('请输入管件保护井砌筑')
- return;
- }
- if (this.isEmpty(this.projectObj.backfill)) {
- this.$modal.msg('请输入回填')
- return;
- }
- if (this.isEmpty(this.projectObj.tamp)) {
- this.$modal.msg('请输入夯实')
- return;
- }
- if (this.isEmpty(this.projectObj.levelingTheSite)) {
- this.$modal.msg('请输入平整场地')
- return;
- }
- if (this.isEmpty(this.projectObj.remark)) {
- this.$modal.msg('请输入备注')
- return;
- }
- if (this.fileArr.length <= 0) {
- this.$modal.msg('请选择附件')
- return;
- }
- this.projectObj.enginTime = this.projectTime;
- this.projectObj.pics = this.fileArr;
- // this.projectObj.files = this.fileArr;
- uni.showLoading()
- updateDangerousWorkProject(this.projectObj).then(res => {
- uni.hideLoading()
- this.$modal.msg(res.msg);
- setTimeout(() => {
- uni.navigateBack();
- }, 1000);
- })
- },
- handleSubmit(e) {
- this.projectTime =
- `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
- this.projectObj.enginTime = this.projectTime;
- },
- // 打开picker
- openDatetimePicker() {
- if (this.isEmpty(this.projectObj.id)) {
- this.$modal.msg('请选择工程')
- } else {
- this.$refs.myPicker.show();
- }
- },
- addTimes(m) {
- return m < 10 ? '0' + m : m
- },
- //获取当前时间
- 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);
- },
- }
- }
- </script>
- <style>
- .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%);
- }
- .marginLeft5 {
- margin-left: 5px;
- }
- .title-txt {
- font-size: 15px;
- font-weight: bold;
- color: black;
- }
- .content-txt {
- font-size: 10px;
- font-weight: bold;
- color: black;
- }
- .background {
- // border: 15px solid hsla(0, 0%, 100%, .5);
- background: white;
- background-clip: padding-box;
- padding: 20rpx;
- border-radius: 20rpx;
- margin: 20rpx;
- /*从padding开始往外面裁剪背景*/
- }
- .uni-list-cell {
- position: relative;
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- align-items: center;
- }
- .uni-list-cell-left {
- white-space: nowrap;
- font-size: 28rpx;
- }
- .centered {
- text-align: center;
- background-color: #e2f4ff;
- }
- .text {
- background-color: #e2f4ff;
- height: 20rpx;
- }
- .view_bg_build {
- background-color: #e2f4ff;
- padding: 10rpx;
- margin: 20rpx;
- }
- .grid-text {
- font-size: 14px;
- color: #000000;
- text-align: center;
- padding-left: 30rpx;
- padding-right: 30rpx;
- padding-top: 20rpx;
- padding-bottom: 20rpx;
- }
- .name {
- flex: 0;
- font-size: 14px;
- color: #000000;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .table-item {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .block-iv {
- width: 10px;
- height: 10px;
- }
- .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以提高视觉效果 */
- }
- .tj-btn {
- height: 69rpx;
- background: #3184f0;
- border-radius: 6rpx;
- font-size: 25rpx;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 69rpx;
- margin: 40rpx 70rpx;
- }
- .sc-btn {
- height: 69rpx;
- background: #f0686b;
- border-radius: 6rpx;
- font-size: 25rpx;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 69rpx;
- margin: 40rpx;
- }
- .num-style {
- background: #e8f4f9;
- margin: 20rpx;
- padding: 10rpx;
- border-radius: 20rpx;
- border: 1px solid #d4e3f0;
- }
- .textarea {
- margin-top: 10upx;
- width: 100%;
- border: 1rpx solid red;
- min-height: 100upx;
- line-height: 20px;
- }
- .text {
- font-size: 16px;
- color: #333;
- }
- input {
- flex-grow: 1;
- font-size: 28rpx;
- color: #808080;
- }
- </style>
|