dangerous.vue 24 KB

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