dangerous.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841
  1. <template>
  2. <!-- 危险作业工程 -->
  3. <view>
  4. <view class="background">
  5. <view class="uni-list">
  6. <view class="container">
  7. <view>
  8. 工程名称
  9. </view>
  10. <view v-if="this.isEmpty(this.projectObj.enginName)" style="margin-top: 10;"
  11. @click="pickerShow('name')">
  12. <span style="color: darkgray;">请选择工程</span>
  13. <uni-icons style=" position: absolute;" type="right" color="darkgray" size="15"></uni-icons>
  14. </view>
  15. <view v-else style="margin-top: 10;" @click="pickerShow('name')">
  16. <span style="color: black;">{{projectObj.enginName}}</span>
  17. <uni-icons style=" position: absolute;" type="right" color="darkgray" size="15"></uni-icons>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="uni-list">
  22. <view class="container">
  23. <view>
  24. 工程地点
  25. </view>
  26. <view style="margin-top: 10;">
  27. <span style="color: black;">{{projectObj.enginAddre}}</span>
  28. </view>
  29. </view>
  30. </view>
  31. <view class="uni-list">
  32. <view class="container">
  33. <view>
  34. 作业基本信息
  35. </view>
  36. <view style="margin-top: 10;">
  37. <span style="color: black;">{{projectObj.basicInformation}}</span>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="background">
  43. <view class="uni-list">
  44. <view class="container">
  45. <view>
  46. 工程时间
  47. </view>
  48. <view v-if="isEmpty(this.projectTime)" @click="openDatetimePicker">
  49. <span style="color: darkgray;">请选择工程时间</span>
  50. <uni-icons style=" position: absolute;" type="right" color="darkgray" size="15"></uni-icons>
  51. </view>
  52. <view v-else @click="openDatetimePicker">
  53. <span style="color: black;">{{projectTime}}</span>
  54. <uni-icons style=" position: absolute;" type="right" color="darkgray" size="15"></uni-icons>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="uni-list">
  59. <view class="container">
  60. <text>管径</text>
  61. <input class="uni-input" type="digit" v-model="projectObj.pipeDiameter" placeholder="请输入管径"
  62. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  63. </view>
  64. </view>
  65. <view class="uni-list">
  66. <view class="container">
  67. <text>管材</text>
  68. <input class="uni-input" type="text" v-model="projectObj.tubularProduct" placeholder="请输入管材"
  69. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  70. </view>
  71. </view>
  72. <view class="uni-list">
  73. <view class="container">
  74. <text>是否存在套管</text>
  75. <view>
  76. <span style="color: black;">{{bushingText}}</span>
  77. <switch v-if="isBushing" checked style="transform: scale(0.6,0.6);"
  78. @change="switchChangePipe" />
  79. <switch v-else style="transform: scale(0.6,0.6);" @change="switchChangePipe" />
  80. </view>
  81. </view>
  82. </view>
  83. <view class="uni-list">
  84. <view class="container">
  85. <text>管道压力</text>
  86. <input class="uni-input" type="digit" v-model="projectObj.pipePressure" placeholder="请输入管道压力"
  87. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  88. </view>
  89. </view>
  90. <view class="uni-list">
  91. <view class="container">
  92. <text>气源方向</text>
  93. <input class="uni-input" type="text" v-model="projectObj.gasSourceDirection" placeholder="请输入气源方向"
  94. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  95. </view>
  96. </view>
  97. <view class="uni-list">
  98. <view class="container">
  99. <text>作业位置</text>
  100. <input class="uni-input" type="text" v-model="projectObj.taskPosition" placeholder="请输入作业位置"
  101. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  102. </view>
  103. </view>
  104. <view class="uni-list">
  105. <view class="container">
  106. <text>作业相关阀门位置</text>
  107. <input class="uni-input" type="text" v-model="projectObj.valvePosition" placeholder="请输入作业相关阀门位置"
  108. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  109. </view>
  110. </view>
  111. <view class="uni-list">
  112. <view class="container">
  113. <text>压力报告</text>
  114. <input class="uni-input" type="text" v-model="projectObj.stressReport" placeholder="请输入压力报告"
  115. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  116. </view>
  117. </view>
  118. <view class="uni-list">
  119. <view class="container">
  120. <text>监理旁站记录</text>
  121. <input class="uni-input" type="text" v-model="projectObj.supervisionRecord" placeholder="请输入监理旁站记录"
  122. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  123. </view>
  124. </view>
  125. <view class="uni-list">
  126. <view class="container">
  127. <text>工作联系单</text>
  128. <input class="uni-input" type="text" v-model="projectObj.workContactForm" placeholder="请输入工作联系单"
  129. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  130. </view>
  131. </view>
  132. <view class="uni-list">
  133. <view class="container">
  134. <text>巡线确认单</text>
  135. <input class="uni-input" type="text" v-model="projectObj.linePatrolConfirmationForm"
  136. placeholder="请输入巡线确认单" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  137. </view>
  138. </view>
  139. <view class="uni-list">
  140. <view class="container">
  141. <text>危险作业坑大小(长,宽,深)</text>
  142. <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsLong" placeholder="请输入长"
  143. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  144. <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsWide" placeholder="请输入宽"
  145. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  146. <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsDeep" placeholder="请输入深"
  147. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  148. </view>
  149. </view>
  150. <view class="uni-list">
  151. <view class="container">
  152. <text>是否需要支护</text>
  153. <view>
  154. <span style="color: black;">{{needSupportText}}</span>
  155. <switch v-if="isNeedSupport" checked style="transform: scale(0.6,0.6);"
  156. @change="switchChangeSupport" />
  157. <switch v-else style="transform: scale(0.6,0.6);" @change="switchChangeSupport" />
  158. </view>
  159. </view>
  160. </view>
  161. <view class="uni-list">
  162. <view class="container">
  163. <text>作业坑内其他管道情况</text>
  164. <input class="uni-input" type="text" v-model="projectObj.otherPipelineConditionsWorkPit"
  165. placeholder="请输入作业坑内其他管道情况" maxlength="100"
  166. style="margin-left: 10px;text-align: right;"></input>
  167. </view>
  168. </view>
  169. <view class="uni-list">
  170. <view class="container">
  171. <text>现场负责人</text>
  172. <input class="uni-input" type="text" v-model="projectObj.siteHead" placeholder="请输入现场负责人"
  173. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  174. </view>
  175. </view>
  176. <view class="uni-list">
  177. <view class="container">
  178. <text>现场负责人联系方式</text>
  179. <input class="uni-input" type="number" v-model="projectObj.siteHeadPhone" placeholder="请输入现场负责人联系方式"
  180. maxlength="11" style="margin-left: 10px;text-align: right;"></input>
  181. </view>
  182. </view>
  183. <view class="uni-list">
  184. <view class="container">
  185. <text>作业人员信息</text>
  186. <input class="uni-input" type="text" v-model="projectObj.operatorInformation"
  187. placeholder="请输入作业人员信息" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  188. </view>
  189. </view>
  190. <view class="uni-list">
  191. <view class="container">
  192. <text>检口</text>
  193. <input class="uni-input" type="text" v-model="projectObj.inspectionPort" placeholder="请输入检口"
  194. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  195. </view>
  196. </view>
  197. <view class="uni-list">
  198. <view class="container">
  199. <text>管道刷油</text>
  200. <input class="uni-input" type="text" v-model="projectObj.pipelinePainting" placeholder="请输入管道刷油"
  201. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  202. </view>
  203. </view>
  204. <view class="uni-list">
  205. <view class="container">
  206. <text>管道防腐</text>
  207. <input class="uni-input" type="text" v-model="projectObj.pipelineCorrosionProtection"
  208. placeholder="请输入管道防腐" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  209. </view>
  210. </view>
  211. <view class="uni-list">
  212. <view class="container">
  213. <text>管道支护</text>
  214. <input class="uni-input" type="text" v-model="projectObj.pipelineSupport" placeholder="请输入管道支护"
  215. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  216. </view>
  217. </view>
  218. <view class="uni-list">
  219. <view class="container">
  220. <text>砌筑阀门井</text>
  221. <input class="uni-input" type="text" v-model="projectObj.masonryValveWell" placeholder="请输入砌筑阀门井"
  222. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  223. </view>
  224. </view>
  225. <view class="uni-list">
  226. <view class="container">
  227. <text>保护井</text>
  228. <input class="uni-input" type="text" v-model="projectObj.protectionWell" placeholder="请输入保护井"
  229. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  230. </view>
  231. </view>
  232. <view class="uni-list">
  233. <view class="container">
  234. <text>管件保护井砌筑</text>
  235. <input class="uni-input" type="text" v-model="projectObj.pipeProtectionWelMasonry"
  236. placeholder="请输入管件保护井砌筑" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  237. </view>
  238. </view>
  239. <view class="uni-list">
  240. <view class="container">
  241. <text>回填</text>
  242. <input class="uni-input" type="text" v-model="projectObj.backfill" placeholder="请输入回填"
  243. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  244. </view>
  245. </view>
  246. <view class="uni-list">
  247. <view class="container">
  248. <text>夯实</text>
  249. <input class="uni-input" type="text" v-model="projectObj.tamp" placeholder="请输入夯实" maxlength="100"
  250. style="margin-left: 10px;text-align: right;"></input>
  251. </view>
  252. </view>
  253. <view class="uni-list">
  254. <view class="container">
  255. <text>平整场地</text>
  256. <input class="uni-input" type="text" v-model="projectObj.levelingTheSite" placeholder="请输入平整场地"
  257. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  258. </view>
  259. </view>
  260. <view class="uni-list">
  261. <view class="container">
  262. <text>备注</text>
  263. <input class="uni-input" type="text" v-model="projectObj.remark" placeholder="请输入备注" maxlength="100"
  264. style="margin-left: 10px;text-align: right;"></input>
  265. </view>
  266. </view>
  267. <view class="uni-list">
  268. <view class="align-items" style="margin-bottom: 20px;">
  269. <view class="container" style="color: gainsboro;">*请上传文件</view>
  270. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  271. <image src="/static/images/chooseimg.png" mode=""
  272. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;; " @click="chooseFile()"></image>
  273. <view v-for="(item,index) in fileArr" :key="index" style="position: relative;">
  274. <view style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
  275. {{item.fileName}}
  276. <image :src="item.picUrl" mode=""
  277. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
  278. </image>
  279. </view>
  280. <view @click="removeFile(index)"
  281. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  282. <uni-icons type="close" color="darkgray" size="18"></uni-icons>
  283. </view>
  284. </view>
  285. </view>
  286. </view>
  287. </view>
  288. <view class="action-btn">
  289. <button @click="submit" class="btn cu-btn block bg-blue lg round">提交</button>
  290. </view>
  291. <SelectPicker :list="rows" @change="projectListSelect" v-if="open" @close="close" titleKey="name"
  292. subtitleKey="id" v-model="name"></SelectPicker>
  293. <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
  294. :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
  295. </view>
  296. </view>
  297. </template>
  298. <script>
  299. import SelectPicker from '../../components/selectPicker/select_picker.vue'
  300. import {
  301. getToken
  302. } from '../../utils/auth';
  303. import {
  304. getDangerousWorkProjectList,
  305. getDangerousWorkProjectDetails,
  306. updateDangerousWorkProject
  307. } from '@/api/common'
  308. export default {
  309. components: {
  310. SelectPicker
  311. },
  312. data() {
  313. return {
  314. headers: {
  315. Authorization: "Bearer " + getToken()
  316. },
  317. isBushing: false,
  318. bushingText: "否",
  319. isNeedSupport: false,
  320. needSupportText: "否",
  321. file: [], // 附件
  322. pics: [], // 附件返回
  323. rows: [],
  324. open: false,
  325. projectObj: {},
  326. currentTime: "",
  327. fileArr: [],
  328. projectTime: "",
  329. }
  330. },
  331. created() {
  332. this.currentTime = this.traversalTime(new Date().getTime()); //在data里定义变量-nowTime
  333. },
  334. methods: {
  335. isEmpty(str) {
  336. return (!str || 0 === str.length);
  337. },
  338. pickerShow(e) {
  339. if (e == 'name') {
  340. this.open = true;
  341. let param = {};
  342. getDangerousWorkProjectList(param).then(res => {
  343. this.rows = res.data;
  344. })
  345. }
  346. },
  347. changeSelect(e) {
  348. },
  349. close() {
  350. this.open = false;
  351. },
  352. projectListSelect(item, index) {
  353. this.open = false;
  354. getDangerousWorkProjectDetails(item.id).then(res => {
  355. this.projectObj = res.data;
  356. this.projectTime = this.projectObj.enginTime;
  357. // if (this.isEmpty(this.projectTime)) {
  358. // this.projectTime = this.currentTime;
  359. // this.projectObj.enginTime = this.currentTime;
  360. // }
  361. this.isNeedSupport = this.projectObj.needSupport == "1";
  362. if (this.isNeedSupport) {
  363. this.needSupportText = "是";
  364. this.projectObj.needSupport="1";
  365. } else {
  366. this.needSupportText = "否";
  367. this.projectObj.needSupport="0";
  368. }
  369. this.isBushing = this.projectObj.casingPresent == "1";
  370. if (this.isBushing) {
  371. this.bushingText = "是";
  372. this.projectObj.casingPresent = "1";
  373. } else {
  374. this.bushingText = "否";
  375. this.projectObj.casingPresent = "0";
  376. }
  377. this.fileArr = this.projectObj.pics;
  378. })
  379. },
  380. switchChangePipe(e) {
  381. this.isBushing = e.detail.value;
  382. if (this.isBushing) {
  383. this.projectObj.casingPresent = "1";
  384. this.bushingText = "是";
  385. } else {
  386. this.projectObj.casingPresent = "0";
  387. this.bushingText = "否";
  388. }
  389. console.log("bush:" + this.isBushing + this.bushingText)
  390. },
  391. switchChangeSupport(e) {
  392. this.isNeedSupport = e.detail.value;
  393. if (this.isNeedSupport) {
  394. this.projectObj.needSupport = "1";
  395. this.needSupportText = "是";
  396. } else {
  397. this.projectObj.needSupport = "0";
  398. this.needSupportText = "否";
  399. }
  400. console.log("bush:" + this.isNeedSupport + this.needSupportText)
  401. },
  402. chooseFile() {
  403. let _this = this;
  404. console.log('文件' + _this.headers);
  405. uni.chooseMessageFile({
  406. // sizeType: ['album', 'camera'],
  407. type: 'all',
  408. extension: ['dwg', 'dwt', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png', 'jpeg', 'mp4'],
  409. success(resp) {
  410. resp.tempFiles.forEach((item, index) => {
  411. const task = uni.uploadFile({
  412. url: _this.$HTTP + `/obs`,
  413. filePath: item.path,
  414. name: 'file',
  415. formData: {},
  416. header: _this.headers,
  417. success: res => {
  418. // 判断是否json字符串,将其转为json格式
  419. // console.log("结果", res)
  420. let data = JSON.parse(res.data);
  421. if (![200].includes(data.code)) {
  422. _this.$modal.msg(data.msg)
  423. } else {
  424. if (_this.progress === 100) {
  425. console.log('_this.progress', _this.progress)
  426. console.log('res--', res)
  427. _this.fileArr.push({
  428. 'fileName': item.name,
  429. 'picUrl': data.data.url,
  430. })
  431. _this.$modal.msg('上传成功!')
  432. }
  433. }
  434. },
  435. fail: e => {
  436. console.log(e)
  437. _this.$modal.msg('上传失败!')
  438. //_this.uploadError(index, e);
  439. },
  440. complete: res => {
  441. uni.hideLoading();
  442. _this.uploading = false;
  443. }
  444. });
  445. task.onProgressUpdate(res => {
  446. _this.progress = res.progress;
  447. console.log('onProgressUpdate', res)
  448. console.log('task.onProgressUpdate', _this.progress)
  449. uni.showLoading({
  450. title: '上传中'
  451. })
  452. if (_this.progress != 100) {
  453. _this.loading = false
  454. console.log('_this.loading false', _this.loading)
  455. } else {
  456. _this.loading = true
  457. console.log('_this.loading true', _this.loading)
  458. }
  459. });
  460. })
  461. },
  462. })
  463. },
  464. removeFile(index) {
  465. uni.showModal({
  466. title: '提示',
  467. content: '是否删除该文件?',
  468. success: (res) => {
  469. if (res.confirm) {
  470. this.fileArr.splice(index, 1)
  471. console.log('this.fileArr', this.fileArr)
  472. }
  473. }
  474. })
  475. },
  476. submit() {
  477. if (this.isEmpty(this.projectObj.pipeDiameter)) {
  478. this.$modal.msg('请输入管径')
  479. return;
  480. }
  481. if (this.isEmpty(this.projectObj.tubularProduct)) {
  482. this.$modal.msg('请输入管材')
  483. return;
  484. }
  485. if (this.isEmpty(this.projectObj.pipePressure)) {
  486. this.$modal.msg('请输入管道压力')
  487. return;
  488. }
  489. if (this.isEmpty(this.projectObj.gasSourceDirection)) {
  490. this.$modal.msg('请输入气源方向')
  491. return;
  492. }
  493. if (this.isEmpty(this.projectObj.taskPosition)) {
  494. this.$modal.msg('请输入作业位置')
  495. return;
  496. }
  497. if (this.isEmpty(this.projectObj.valvePosition)) {
  498. this.$modal.msg('请输入作业相关阀门位置')
  499. return;
  500. }
  501. if (this.isEmpty(this.projectObj.stressReport)) {
  502. this.$modal.msg('请输入压力报告')
  503. return;
  504. }
  505. if (this.isEmpty(this.projectObj.supervisionRecord)) {
  506. this.$modal.msg('请输入监理旁站记录')
  507. return;
  508. }
  509. if (this.isEmpty(this.projectObj.workContactForm)) {
  510. this.$modal.msg('请输入工作联系单')
  511. return;
  512. }
  513. if (this.isEmpty(this.projectObj.linePatrolConfirmationForm)) {
  514. this.$modal.msg('请输入巡线确认单')
  515. return;
  516. }
  517. if (this.isEmpty(this.projectObj.hazardousWorkPitsLong)) {
  518. this.$modal.msg('请输入危险作业坑长度')
  519. return;
  520. }
  521. if (this.isEmpty(this.projectObj.hazardousWorkPitsWide)) {
  522. this.$modal.msg('请输入危险作业坑宽度')
  523. return;
  524. }
  525. if (this.isEmpty(this.projectObj.hazardousWorkPitsDeep)) {
  526. this.$modal.msg('请输入危险作业坑深度')
  527. return;
  528. }
  529. if (this.isEmpty(this.projectObj.otherPipelineConditionsWorkPit)) {
  530. this.$modal.msg('请输入作业坑内其他管道情况')
  531. return;
  532. }
  533. if (this.isEmpty(this.projectObj.siteHead)) {
  534. this.$modal.msg('请输入现场负责人')
  535. return;
  536. }
  537. if (this.isEmpty(this.projectObj.siteHeadPhone)) {
  538. this.$modal.msg('请输入现场负责人联系方式')
  539. return;
  540. } else {
  541. if (!this.$validation.mobile(this.projectObj.siteHeadPhone)) {
  542. this.$modal.msg('请输入正确的联系方式');
  543. return;
  544. }
  545. }
  546. if (this.isEmpty(this.projectObj.operatorInformation)) {
  547. this.$modal.msg('请输入作业人员信息')
  548. return;
  549. }
  550. if (this.isEmpty(this.projectObj.inspectionPort)) {
  551. this.$modal.msg('请输入检口')
  552. return;
  553. }
  554. if (this.isEmpty(this.projectObj.pipelinePainting)) {
  555. this.$modal.msg('请输入管道刷油')
  556. return;
  557. }
  558. if (this.isEmpty(this.projectObj.pipelineCorrosionProtection)) {
  559. this.$modal.msg('请输入管道防腐')
  560. return;
  561. }
  562. if (this.isEmpty(this.projectObj.pipelineSupport)) {
  563. this.$modal.msg('请输入管道支护')
  564. return;
  565. }
  566. if (this.isEmpty(this.projectObj.masonryValveWell)) {
  567. this.$modal.msg('请输入砌筑阀门井')
  568. return;
  569. }
  570. if (this.isEmpty(this.projectObj.protectionWell)) {
  571. this.$modal.msg('请输入保护井')
  572. return;
  573. }
  574. if (this.isEmpty(this.projectObj.pipeProtectionWelMasonry)) {
  575. this.$modal.msg('请输入管件保护井砌筑')
  576. return;
  577. }
  578. if (this.isEmpty(this.projectObj.backfill)) {
  579. this.$modal.msg('请输入回填')
  580. return;
  581. }
  582. if (this.isEmpty(this.projectObj.tamp)) {
  583. this.$modal.msg('请输入夯实')
  584. return;
  585. }
  586. if (this.isEmpty(this.projectObj.levelingTheSite)) {
  587. this.$modal.msg('请输入平整场地')
  588. return;
  589. }
  590. if (this.isEmpty(this.projectObj.remark)) {
  591. this.$modal.msg('请输入备注')
  592. return;
  593. }
  594. if (this.fileArr.length <= 0) {
  595. this.$modal.msg('请选择附件')
  596. return;
  597. }
  598. this.projectObj.enginTime = this.projectTime;
  599. this.projectObj.pics = this.fileArr;
  600. updateDangerousWorkProject(this.projectObj).then(res => {
  601. this.$modal.msg(res.msg);
  602. uni.navigateBack();
  603. })
  604. },
  605. handleSubmit(e) {
  606. this.projectTime = `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  607. this.projectObj.enginTime = this.projectTime;
  608. },
  609. // 打开picker
  610. openDatetimePicker() {
  611. if (this.isEmpty(this.projectObj.id)) {
  612. this.$modal.msg('请选择工程')
  613. } else {
  614. this.$refs.myPicker.show();
  615. }
  616. },
  617. addTimes(m) {
  618. return m < 10 ? '0' + m : m
  619. },
  620. //获取当前时间
  621. traversalTime(timestamp) {
  622. //timestamp(时间戳)是整数,否则要parseInt转换
  623. let time = new Date(timestamp);
  624. let y = time.getFullYear();
  625. let m = time.getMonth() + 1;
  626. let d = time.getDate();
  627. let h = time.getHours();
  628. let mm = time.getMinutes();
  629. let s = time.getSeconds();
  630. return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(h) + ':' + this.addTimes(
  631. mm) + ':' + this.addTimes(s);
  632. },
  633. }
  634. }
  635. </script>
  636. <style>
  637. .container {
  638. display: flex;
  639. margin-left: 10px;
  640. margin-top: 10px;
  641. margin-right: 10px;
  642. align-items: flex-start;
  643. justify-content: space-between;
  644. }
  645. .marginLeft5 {
  646. margin-left: 5px;
  647. }
  648. .title-txt {
  649. font-size: 15px;
  650. font-weight: bold;
  651. color: black;
  652. }
  653. .content-txt {
  654. font-size: 10px;
  655. font-weight: bold;
  656. color: black;
  657. }
  658. .background {
  659. margin: 8px;
  660. padding: 10px;
  661. background-color: #fff;
  662. border-radius: 5px;
  663. padding-left: 5px;
  664. padding-right: 10px;
  665. }
  666. .uni-list-cell {
  667. position: relative;
  668. display: flex;
  669. flex-direction: row;
  670. justify-content: space-between;
  671. align-items: center;
  672. }
  673. .uni-list-cell-left {
  674. white-space: nowrap;
  675. font-size: 28rpx;
  676. }
  677. .centered {
  678. text-align: center;
  679. background-color: #e2f4ff;
  680. }
  681. .text {
  682. background-color: #e2f4ff;
  683. height: 20rpx;
  684. }
  685. .view_bg_build {
  686. background-color: #e2f4ff;
  687. padding: 10rpx;
  688. margin: 20rpx;
  689. }
  690. .grid-text {
  691. font-size: 14px;
  692. color: #000000;
  693. text-align: center;
  694. padding-left: 30rpx;
  695. padding-right: 30rpx;
  696. padding-top: 20rpx;
  697. padding-bottom: 20rpx;
  698. }
  699. .name {
  700. flex: 0;
  701. font-size: 14px;
  702. color: #000000;
  703. overflow: hidden;
  704. text-overflow: ellipsis;
  705. white-space: nowrap;
  706. }
  707. .table-item {
  708. overflow: hidden;
  709. text-overflow: ellipsis;
  710. white-space: nowrap;
  711. }
  712. .block-iv {
  713. width: 10px;
  714. height: 10px;
  715. }
  716. .btn {
  717. margin-top: 40px;
  718. margin-right: 20px;
  719. margin-bottom: 120px;
  720. margin-left: 20px;
  721. height: 45px;
  722. }
  723. .number {
  724. display: flex;
  725. /* 水平居中显示子元素 */
  726. align-items: flex-start;
  727. /* 垂直居中显示子元素 */
  728. justify-content: space-between;
  729. /* 左右间距等于间距大小 */
  730. padding: 10px;
  731. /* 设置padding以提高视觉效果 */
  732. }
  733. .textarea {
  734. margin-top: 10upx;
  735. width: 100%;
  736. border: 1rpx solid red;
  737. min-height: 100upx;
  738. line-height: 20px;
  739. }
  740. .text {
  741. font-size: 16px;
  742. color: #333;
  743. }
  744. input {
  745. flex-grow: 1;
  746. font-size: 28rpx;
  747. color: #808080;
  748. }
  749. </style>