123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979 |
- <template>
- <!-- 危险作业工程 -->
- <view>
- <view class="background">
- <view class="uni-list">
- <view class="container">
- <view>
- 工程名称
- </view>
- <view v-if="this.isEmpty(this.projectObj.enginName)" style="margin-top: 10;"
- @click="pickerShow('name')">
- <span style="color: darkgray;">请选择工程</span>
- <image src="../../static/images/icon_right.png"
- style=" position: absolute; width: 15px;height: 15px;"></image>
- </view>
- <view v-else style="margin-top: 10;" @click="pickerShow('name')">
- <span style="color: black;">{{projectObj.enginName}}</span>
- <image src="../../static/images/icon_right.png"
- style=" position: absolute; width: 15px;height: 15px;"></image>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="container">
- <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">
- <view>
- 工程时间
- </view>
- <view v-if="isEmpty(this.projectTime)" @click="openDatetimePicker">
- <span style="color: darkgray;">请选择工程时间</span>
- <image src="../../static/images/icon_right.png"
- style=" position: absolute; width: 15px;height: 15px;"></image>
- </view>
- <view v-else @click="openDatetimePicker">
- <span style="color: black;">{{projectTime}}</span>
- <image src="../../static/images/icon_right.png"
- style=" position: absolute; width: 15px;height: 15px;"></image>
- </view>
- </view>
- </view>
- <view class="uni-list">
- <view class="container">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <text>危险作业坑大小(长,宽,深)</text>
- <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsLong" placeholder="请输入长"
- maxlength="9" style="margin-left: 10px;text-align: right;"></input>
- <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsWide" placeholder="请输入宽"
- maxlength="9" style="margin-left: 10px;text-align: right;"></input>
- <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsDeep" placeholder="请输入深"
- maxlength="9" style="margin-left: 10px;text-align: right;"></input>
- </view>
- </view>
- <view class="uni-list">
- <view class="container">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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">
- <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: gainsboro;">*请上传文件</view>
- <view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
- <!-- -->
- <image src="/static/images/chooseimg.png" mode=""
- style="width: 100rpx; height: 100rpx; margin: 0 12rpx;; " @click="chooseFile()"></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(imgList.indexOf(item.picUrl),imgList)"
- 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 style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
- @click="chooseModel(item.picUrl,item.fileName)">
- {{item.fileName}}
- </text>
- </view>
- <view v-if="isShowRemoveFile(item)" @click="removeFile(index)"
- style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
- <image src="../../static/images/icon_close.png" style=" width: 15px; height: 15px;">
- </image>
- </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>
- </view>
- </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;
- console.log("复制")
- if (!_this.isEmpty(_this.fileUrl)) {
- console.log(_this.fileUrl)
- console.log(_this.fileName)
- uni.setClipboardData({
- data: _this.fileUrl,
- success() {
- uni.showToast({
- title: '已复制' + _this.fileName + '地址成功 请在浏览器打开',
- icon: 'none'
- });
- },
- fail(e) {
- console.log("失败", 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();
- console.log('点击下载', url);
- console.log('点击下载333', savePath);
- //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) => {
- console.log('保存路径', resData.savedFilePath)
- uni.showToast({
- title: '下载成功'
- })
- },
- fail: error => {
- console.log('error: ', error)
- }
- })
- }
- }
- })
- },
- showPhoto(index, list) {
- uni.previewImage({
- current: index,
- urls: list,
- })
- },
- 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 = "否";
- }
- console.log("bush:" + this.isBushing + 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 = "否";
- }
- console.log("bush:" + this.isNeedSupport + this.needSupportText)
- },
- chooseFile() {
- let _this = this;
- console.log('文件' + _this.headers);
- uni.chooseMessageFile({
- // sizeType: ['album', 'camera'],
- type: 'all',
- // extension: ['dwg', 'dwt', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png', 'jpeg', 'mp4'],
- 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 = JSON.parse(res.data);
- if (![200].includes(data.code)) {
- _this.$modal.msg(data.msg)
- } else {
- if (_this.progress === 100) {
- console.log(
- '_this.progress',
- _this.progress)
- console.log('res--', res)
- _this.fileArr.push({
- 'fileName': item
- .name,
- 'picUrl': data
- .data.url,
- })
- _this.$modal.msg('上传成功!')
- }
- }
- },
- 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)
- }
- });
- })
- },
- })
- },
- isShowRemoveFile(item) {
- var isShow = item.createBy == this.$user.state.name;
- console.log("isShow:" + isShow + "_name:" + this.$user.state.name + "_createBy:" +
- item.createBy)
- return isShow;
- },
- removeFile(index) {
- uni.showModal({
- title: '提示',
- content: '是否删除该文件?',
- success: (res) => {
- if (res.confirm) {
- this.fileArr.splice(index, 1)
- console.log('this.fileArr', this.fileArr)
- }
- }
- })
- },
- 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;
- updateDangerousWorkProject(this.projectObj).then(res => {
- 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;
- margin-left: 10px;
- margin-top: 10px;
- margin-right: 10px;
- align-items: flex-start;
- justify-content: space-between;
- }
- .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 {
- margin: 8px;
- padding: 10px;
- background-color: #fff;
- border-radius: 5px;
- padding-left: 5px;
- padding-right: 10px;
- }
- .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 {
- margin-top: 40px;
- margin-right: 20px;
- margin-bottom: 120px;
- margin-left: 20px;
- height: 45px;
- }
- .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;
- }
- .text {
- font-size: 16px;
- color: #333;
- }
- input {
- flex-grow: 1;
- font-size: 28rpx;
- color: #808080;
- }
- </style>
|