dangerous.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016
  1. <template>
  2. <!-- 危险作业工程 -->
  3. <scroll-view>
  4. <view class="background">
  5. <view class="uni-list">
  6. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  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="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  14. </view>
  15. <view v-else style="margin-top: 10;" @click="pickerShow('name')">
  16. <span style="color: black;">{{projectObj.enginName}}</span>
  17. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  18. </view>
  19. </view>
  20. </view>
  21. <view class="uni-list">
  22. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  45. <view>
  46. 工程时间
  47. </view>
  48. <view v-if="isEmpty(this.projectTime)" @click="openDatetimePicker">
  49. <span style="color: darkgray;">请选择工程时间</span>
  50. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  51. </view>
  52. <view v-else @click="openDatetimePicker">
  53. <span style="color: black;">{{projectTime}}</span>
  54. <image :src="loadImgSrc('icon_right.png')" class="to-right-icon"></image>
  55. </view>
  56. </view>
  57. </view>
  58. <view class="uni-list">
  59. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  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" style="border-bottom: 1px solid #f8f8f8;">
  141. <text>危险作业坑大小(长,宽,深)</text>
  142. <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsLong" placeholder="请输入长"
  143. maxlength="9"
  144. style="margin-left: 10px;text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  145. <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsWide" placeholder="请输入宽"
  146. maxlength="9"
  147. style="margin-left: 10px;text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  148. <input class="uni-input" type="digit" v-model="projectObj.hazardousWorkPitsDeep" placeholder="请输入深"
  149. maxlength="9"
  150. style="margin-left: 10px;text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  151. </view>
  152. </view>
  153. <view class="uni-list">
  154. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  155. <text>是否需要支护</text>
  156. <view>
  157. <span style="color: black;">{{needSupportText}}</span>
  158. <switch v-if="isNeedSupport" checked style="transform: scale(0.6,0.6);"
  159. @change="switchChangeSupport" />
  160. <switch v-else style="transform: scale(0.6,0.6);" @change="switchChangeSupport" />
  161. </view>
  162. </view>
  163. </view>
  164. <view class="uni-list">
  165. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  166. <text>作业坑内其他管道情况</text>
  167. <input class="uni-input" type="text" v-model="projectObj.otherPipelineConditionsWorkPit"
  168. placeholder="请输入作业坑内其他管道情况" maxlength="100"
  169. style="margin-left: 10px;text-align: right;"></input>
  170. </view>
  171. </view>
  172. <view class="uni-list">
  173. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  174. <text>现场负责人</text>
  175. <input class="uni-input" type="text" v-model="projectObj.siteHead" placeholder="请输入现场负责人"
  176. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  177. </view>
  178. </view>
  179. <view class="uni-list">
  180. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  181. <text>现场负责人联系方式</text>
  182. <input class="uni-input" type="number" v-model="projectObj.siteHeadPhone" placeholder="请输入现场负责人联系方式"
  183. maxlength="11" style="margin-left: 10px;text-align: right;"></input>
  184. </view>
  185. </view>
  186. <view class="uni-list">
  187. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  188. <text>作业人员信息</text>
  189. <input class="uni-input" type="text" v-model="projectObj.operatorInformation"
  190. placeholder="请输入作业人员信息" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  191. </view>
  192. </view>
  193. <view class="uni-list">
  194. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  195. <text>检口</text>
  196. <input class="uni-input" type="text" v-model="projectObj.inspectionPort" placeholder="请输入检口"
  197. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  198. </view>
  199. </view>
  200. <view class="uni-list">
  201. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  202. <text>管道刷油</text>
  203. <input class="uni-input" type="text" v-model="projectObj.pipelinePainting" placeholder="请输入管道刷油"
  204. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  205. </view>
  206. </view>
  207. <view class="uni-list">
  208. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  209. <text>管道防腐</text>
  210. <input class="uni-input" type="text" v-model="projectObj.pipelineCorrosionProtection"
  211. placeholder="请输入管道防腐" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  212. </view>
  213. </view>
  214. <view class="uni-list">
  215. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  216. <text>管道支护</text>
  217. <input class="uni-input" type="text" v-model="projectObj.pipelineSupport" placeholder="请输入管道支护"
  218. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  219. </view>
  220. </view>
  221. <view class="uni-list">
  222. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  223. <text>砌筑阀门井</text>
  224. <input class="uni-input" type="text" v-model="projectObj.masonryValveWell" placeholder="请输入砌筑阀门井"
  225. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  226. </view>
  227. </view>
  228. <view class="uni-list">
  229. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  230. <text>保护井</text>
  231. <input class="uni-input" type="text" v-model="projectObj.protectionWell" placeholder="请输入保护井"
  232. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  233. </view>
  234. </view>
  235. <view class="uni-list">
  236. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  237. <text>管件保护井砌筑</text>
  238. <input class="uni-input" type="text" v-model="projectObj.pipeProtectionWelMasonry"
  239. placeholder="请输入管件保护井砌筑" maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  240. </view>
  241. </view>
  242. <view class="uni-list">
  243. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  244. <text>回填</text>
  245. <input class="uni-input" type="text" v-model="projectObj.backfill" placeholder="请输入回填"
  246. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  247. </view>
  248. </view>
  249. <view class="uni-list">
  250. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  251. <text>夯实</text>
  252. <input class="uni-input" type="text" v-model="projectObj.tamp" placeholder="请输入夯实" maxlength="100"
  253. style="margin-left: 10px;text-align: right;"></input>
  254. </view>
  255. </view>
  256. <view class="uni-list">
  257. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  258. <text>平整场地</text>
  259. <input class="uni-input" type="text" v-model="projectObj.levelingTheSite" placeholder="请输入平整场地"
  260. maxlength="100" style="margin-left: 10px;text-align: right;"></input>
  261. </view>
  262. </view>
  263. <view class="uni-list">
  264. <view class="container" style="border-bottom: 1px solid #f8f8f8;">
  265. <text>备注</text>
  266. <input class="uni-input" type="text" v-model="projectObj.remark" placeholder="请输入备注" maxlength="100"
  267. style="margin-left: 10px;text-align: right;"></input>
  268. </view>
  269. </view>
  270. <view class="uni-list">
  271. <view class="align-items" style="margin-bottom: 20px;">
  272. <view class="container" style="color: #b2b2b2;">*请上传文件</view>
  273. <view style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  274. <!-- -->
  275. <image :src="loadImgSrc('updateimg.png')" mode=""
  276. style="width: 200rpx; height: 150rpx; 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. <image
  280. 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' "
  281. :src="item.picUrl" @click="this.showPhoto(imgList.indexOf(item.picUrl),imgList)"
  282. style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
  283. </image>
  284. <video v-else-if="item.picUrl.substring(item.picUrl.length - 3) == 'mp4'"
  285. :src="item.picUrl" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;">
  286. </video>
  287. <text v-else style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  288. @click="chooseModel(item.picUrl,item.fileName)">
  289. {{item.fileName}}
  290. </text>
  291. </view>
  292. <view v-if="isShowRemoveFile(item)" @click="removeFile(index)"
  293. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  294. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  295. </image>
  296. </view>
  297. </view>
  298. </view>
  299. </view>
  300. </view>
  301. </view>
  302. <view class="action-btn">
  303. <button @click="submit" class="btn cu-btn block bg-blue lg round">提交</button>
  304. </view>
  305. <SelectPicker :list="rows" @change="projectListSelect" v-if="open" @close="close" titleKey="name"
  306. subtitleKey="id" v-model="name"></SelectPicker>
  307. <yt-dateTimePicker ref="myPicker" @submit="handleSubmit" :start-year="2024" :end-year="2099"
  308. :time-hide="[true, true, true, true, true, true]" :time-label="['年', '月', '日', '时', '分', '秒']" />
  309. <!-- 下载提示页面 -->
  310. <mypopup :show="show_loding" :popupText="popupText" :titleText="titleText" :cancelText="cancelText"
  311. :confirmText="confirmText" @close="cancel_loding" @confirm="confirm_loding">
  312. </mypopup>
  313. </scroll-view>
  314. </template>
  315. <script>
  316. import SelectPicker from '../../components/selectPicker/select_picker.vue'
  317. import {
  318. getToken
  319. } from '../../utils/auth';
  320. import {
  321. getDangerousWorkProjectList,
  322. getDangerousWorkProjectDetails,
  323. updateDangerousWorkProject
  324. } from '@/api/common'
  325. export default {
  326. components: {
  327. SelectPicker
  328. },
  329. data() {
  330. return {
  331. headers: {
  332. Authorization: "Bearer " + getToken()
  333. },
  334. isBushing: false,
  335. bushingText: "否",
  336. isNeedSupport: false,
  337. needSupportText: "否",
  338. file: [], // 附件
  339. pics: [], // 附件返回
  340. rows: [],
  341. open: false,
  342. projectObj: {},
  343. currentTime: "",
  344. fileArr: [],
  345. projectTime: "",
  346. imgList: [],
  347. popupText: '', //对话框内容
  348. titleText: '',
  349. cancelText: '',
  350. confirmText: '',
  351. show_loding: false,
  352. fileUrl: '', //点击的文件地址
  353. fileName: '', //点击的文件名称
  354. }
  355. },
  356. created() {
  357. this.currentTime = this.traversalTime(new Date().getTime()); //在data里定义变量-nowTime
  358. },
  359. methods: {
  360. isEmpty(str) {
  361. return (!str || 0 === str.length);
  362. },
  363. chooseModel(url, name) {
  364. this.cancelText = '复制';
  365. this.confirmText = "下载";
  366. this.titleText = "温馨提示"
  367. this.popupText = "下载或者复制链接";
  368. this.show_loding = true;
  369. this.fileName = name;
  370. this.fileUrl = url; //文件名称和下载地址赋值
  371. },
  372. //取消按钮
  373. cancel_loding() {
  374. let _this = this;
  375. _this.show_loding = false;
  376. if (!_this.isEmpty(_this.fileUrl)) {
  377. uni.setClipboardData({
  378. data: _this.fileUrl,
  379. success() {
  380. uni.showToast({
  381. title: '已复制' + _this.fileName + '地址成功 请在浏览器打开',
  382. icon: 'none'
  383. });
  384. },
  385. fail(e) {
  386. uni.showToast({
  387. title: '复制失败',
  388. icon: 'none'
  389. });
  390. }
  391. });
  392. }
  393. },
  394. //确定按钮
  395. confirm_loding() {
  396. this.show_loding = false;
  397. this.download(this.fileUrl, this.fileName);
  398. },
  399. getDownLoadFilePath() {
  400. let cachePath = `${uni.env.USER_DATA_PATH}/downloads`
  401. let fm = uni.getFileSystemManager()
  402. try {
  403. // 访问成功则存在
  404. fm.accessSync(cachePath)
  405. } catch (error) {
  406. // 不存在则新建
  407. fm.mkdirSync(cachePath, true)
  408. }
  409. return cachePath
  410. },
  411. download(url, name) {
  412. let savePath = this.getDownLoadFilePath();
  413. //var savePath = uni.env.USER_DATA_PATH + '/savePath'
  414. uni.downloadFile({
  415. url: url,
  416. success: response => {
  417. if (response.statusCode === 200) {
  418. uni.getFileSystemManager().saveFile({
  419. tempFilePath: response.tempFilePath,
  420. filePath: `${savePath}/${name}`,
  421. success: (resData) => {
  422. uni.showToast({
  423. title: '下载成功'
  424. })
  425. },
  426. fail: error => {}
  427. })
  428. }
  429. }
  430. })
  431. },
  432. showPhoto(index, list) {
  433. uni.previewImage({
  434. current: index,
  435. urls: list,
  436. })
  437. },
  438. pickerShow(e) {
  439. if (e == 'name') {
  440. this.open = true;
  441. let param = {};
  442. getDangerousWorkProjectList(param).then(res => {
  443. this.rows = res.data;
  444. })
  445. }
  446. },
  447. changeSelect(e) {
  448. },
  449. close() {
  450. this.open = false;
  451. },
  452. projectListSelect(item, index) {
  453. this.open = false;
  454. getDangerousWorkProjectDetails(item.id).then(res => {
  455. this.projectObj = res.data;
  456. this.projectTime = this.projectObj.enginTime;
  457. // if (this.isEmpty(this.projectTime)) {
  458. // this.projectTime = this.currentTime;
  459. // this.projectObj.enginTime = this.currentTime;
  460. // }
  461. this.isNeedSupport = this.projectObj.needSupport == "1";
  462. if (this.isNeedSupport) {
  463. this.needSupportText = "是";
  464. this.projectObj.needSupport = "1";
  465. } else {
  466. this.needSupportText = "否";
  467. this.projectObj.needSupport = "0";
  468. }
  469. this.isBushing = this.projectObj.casingPresent == "1";
  470. if (this.isBushing) {
  471. this.bushingText = "是";
  472. this.projectObj.casingPresent = "1";
  473. } else {
  474. this.bushingText = "否";
  475. this.projectObj.casingPresent = "0";
  476. }
  477. this.fileArr = this.projectObj.pics;
  478. for (let i = 0; i < this.fileArr.length; i++) {
  479. if (this.fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 3) == 'png' || this
  480. .fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 3) == 'jpg' ||
  481. this.fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 4) ==
  482. 'jpeg') {
  483. this.imgList.push(this.fileArr[i].picUrl);
  484. }
  485. }
  486. })
  487. },
  488. switchChangePipe(e) {
  489. this.isBushing = e.detail.value;
  490. if (this.isBushing) {
  491. this.projectObj.casingPresent = "1";
  492. this.bushingText = "是";
  493. } else {
  494. this.projectObj.casingPresent = "0";
  495. this.bushingText = "否";
  496. }
  497. },
  498. switchChangeSupport(e) {
  499. this.isNeedSupport = e.detail.value;
  500. if (this.isNeedSupport) {
  501. this.projectObj.needSupport = "1";
  502. this.needSupportText = "是";
  503. } else {
  504. this.projectObj.needSupport = "0";
  505. this.needSupportText = "否";
  506. }
  507. },
  508. chooseFile() {
  509. if (this.isEmpty(this.projectObj.id)) {
  510. this.$modal.msg('请选择工程')
  511. return;
  512. }
  513. let _this = this;
  514. uni.chooseMessageFile({
  515. // sizeType: ['album', 'camera'],
  516. type: 'all',
  517. // extension: ['dwg', 'dwt', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png', 'jpeg', 'mp4'],
  518. success(resp) {
  519. resp.tempFiles.forEach((item, index) => {
  520. const task = uni.uploadFile({
  521. url: _this.$HTTP + `/obs`,
  522. filePath: item.path,
  523. name: 'file',
  524. formData: {},
  525. header: _this.headers,
  526. success: res => {
  527. // 判断是否json字符串,将其转为json格式
  528. let data = JSON.parse(res.data);
  529. if (![200].includes(data.code)) {
  530. _this.$modal.msg(data.msg)
  531. } else {
  532. if (_this.progress === 100) {
  533. _this.fileArr.push({
  534. 'fileName': item
  535. .name,
  536. 'picUrl': data
  537. .data.url,
  538. })
  539. _this.$modal.msg('上传成功!')
  540. }
  541. }
  542. },
  543. fail: e => {
  544. _this.$modal.msg('上传失败!')
  545. //_this.uploadError(index, e);
  546. },
  547. complete: res => {
  548. uni.hideLoading();
  549. _this.uploading = false;
  550. }
  551. });
  552. task.onProgressUpdate(res => {
  553. _this.progress = res.progress;
  554. uni.showLoading({
  555. title: '上传中'
  556. })
  557. if (_this.progress != 100) {
  558. _this.loading = false
  559. } else {
  560. _this.loading = true
  561. }
  562. });
  563. })
  564. },
  565. })
  566. },
  567. isShowRemoveFile(item) {
  568. var isShow = item.createBy == this.$user.state.name;
  569. return isShow;
  570. },
  571. removeFile(index) {
  572. uni.showModal({
  573. title: '提示',
  574. content: '是否删除该文件?',
  575. success: (res) => {
  576. if (res.confirm) {
  577. this.fileArr.splice(index, 1)
  578. }
  579. }
  580. })
  581. },
  582. submit() {
  583. if (this.isEmpty(this.projectObj.pipeDiameter)) {
  584. this.$modal.msg('请输入管径')
  585. return;
  586. }
  587. if (this.isEmpty(this.projectObj.tubularProduct)) {
  588. this.$modal.msg('请输入管材')
  589. return;
  590. }
  591. if (this.isEmpty(this.projectObj.pipePressure)) {
  592. this.$modal.msg('请输入管道压力')
  593. return;
  594. }
  595. if (this.isEmpty(this.projectObj.gasSourceDirection)) {
  596. this.$modal.msg('请输入气源方向')
  597. return;
  598. }
  599. if (this.isEmpty(this.projectObj.taskPosition)) {
  600. this.$modal.msg('请输入作业位置')
  601. return;
  602. }
  603. if (this.isEmpty(this.projectObj.valvePosition)) {
  604. this.$modal.msg('请输入作业相关阀门位置')
  605. return;
  606. }
  607. if (this.isEmpty(this.projectObj.stressReport)) {
  608. this.$modal.msg('请输入压力报告')
  609. return;
  610. }
  611. if (this.isEmpty(this.projectObj.supervisionRecord)) {
  612. this.$modal.msg('请输入监理旁站记录')
  613. return;
  614. }
  615. if (this.isEmpty(this.projectObj.workContactForm)) {
  616. this.$modal.msg('请输入工作联系单')
  617. return;
  618. }
  619. if (this.isEmpty(this.projectObj.linePatrolConfirmationForm)) {
  620. this.$modal.msg('请输入巡线确认单')
  621. return;
  622. }
  623. if (this.isEmpty(this.projectObj.hazardousWorkPitsLong)) {
  624. this.$modal.msg('请输入危险作业坑长度')
  625. return;
  626. }
  627. if (this.isEmpty(this.projectObj.hazardousWorkPitsWide)) {
  628. this.$modal.msg('请输入危险作业坑宽度')
  629. return;
  630. }
  631. if (this.isEmpty(this.projectObj.hazardousWorkPitsDeep)) {
  632. this.$modal.msg('请输入危险作业坑深度')
  633. return;
  634. }
  635. if (this.isEmpty(this.projectObj.otherPipelineConditionsWorkPit)) {
  636. this.$modal.msg('请输入作业坑内其他管道情况')
  637. return;
  638. }
  639. if (this.isEmpty(this.projectObj.siteHead)) {
  640. this.$modal.msg('请输入现场负责人')
  641. return;
  642. }
  643. if (this.isEmpty(this.projectObj.siteHeadPhone)) {
  644. this.$modal.msg('请输入现场负责人联系方式')
  645. return;
  646. } else {
  647. if (!this.$validation.mobile(this.projectObj.siteHeadPhone)) {
  648. this.$modal.msg('请输入正确的联系方式');
  649. return;
  650. }
  651. }
  652. if (this.isEmpty(this.projectObj.operatorInformation)) {
  653. this.$modal.msg('请输入作业人员信息')
  654. return;
  655. }
  656. if (this.isEmpty(this.projectObj.inspectionPort)) {
  657. this.$modal.msg('请输入检口')
  658. return;
  659. }
  660. if (this.isEmpty(this.projectObj.pipelinePainting)) {
  661. this.$modal.msg('请输入管道刷油')
  662. return;
  663. }
  664. if (this.isEmpty(this.projectObj.pipelineCorrosionProtection)) {
  665. this.$modal.msg('请输入管道防腐')
  666. return;
  667. }
  668. if (this.isEmpty(this.projectObj.pipelineSupport)) {
  669. this.$modal.msg('请输入管道支护')
  670. return;
  671. }
  672. if (this.isEmpty(this.projectObj.masonryValveWell)) {
  673. this.$modal.msg('请输入砌筑阀门井')
  674. return;
  675. }
  676. if (this.isEmpty(this.projectObj.protectionWell)) {
  677. this.$modal.msg('请输入保护井')
  678. return;
  679. }
  680. if (this.isEmpty(this.projectObj.pipeProtectionWelMasonry)) {
  681. this.$modal.msg('请输入管件保护井砌筑')
  682. return;
  683. }
  684. if (this.isEmpty(this.projectObj.backfill)) {
  685. this.$modal.msg('请输入回填')
  686. return;
  687. }
  688. if (this.isEmpty(this.projectObj.tamp)) {
  689. this.$modal.msg('请输入夯实')
  690. return;
  691. }
  692. if (this.isEmpty(this.projectObj.levelingTheSite)) {
  693. this.$modal.msg('请输入平整场地')
  694. return;
  695. }
  696. if (this.isEmpty(this.projectObj.remark)) {
  697. this.$modal.msg('请输入备注')
  698. return;
  699. }
  700. if (this.fileArr.length <= 0) {
  701. this.$modal.msg('请选择附件')
  702. return;
  703. }
  704. this.projectObj.enginTime = this.projectTime;
  705. this.projectObj.pics = this.fileArr;
  706. uni.showLoading()
  707. updateDangerousWorkProject(this.projectObj).then(res => {
  708. uni.hideLoading()
  709. this.$modal.msg(res.msg);
  710. setTimeout(() => {
  711. uni.navigateBack();
  712. }, 1000);
  713. })
  714. },
  715. handleSubmit(e) {
  716. this.projectTime =
  717. `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  718. this.projectObj.enginTime = this.projectTime;
  719. },
  720. // 打开picker
  721. openDatetimePicker() {
  722. if (this.isEmpty(this.projectObj.id)) {
  723. this.$modal.msg('请选择工程')
  724. } else {
  725. this.$refs.myPicker.show();
  726. }
  727. },
  728. addTimes(m) {
  729. return m < 10 ? '0' + m : m
  730. },
  731. //获取当前时间
  732. traversalTime(timestamp) {
  733. //timestamp(时间戳)是整数,否则要parseInt转换
  734. let time = new Date(timestamp);
  735. let y = time.getFullYear();
  736. let m = time.getMonth() + 1;
  737. let d = time.getDate();
  738. let h = time.getHours();
  739. let mm = time.getMinutes();
  740. let s = time.getSeconds();
  741. return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(
  742. h) + ':' + this.addTimes(
  743. mm) + ':' + this.addTimes(s);
  744. },
  745. }
  746. }
  747. </script>
  748. <style>
  749. .container {
  750. display: flex;
  751. align-items: center;
  752. justify-content: space-between;
  753. padding: 10px;
  754. position: relative;
  755. }
  756. .uni-list {
  757. border: 1xp solid #eee;
  758. }
  759. .to-right-icon {
  760. width: 15px;
  761. height: 15px;
  762. position: absolute;
  763. top: 50%;
  764. transform: translateY(-50%);
  765. }
  766. .marginLeft5 {
  767. margin-left: 5px;
  768. }
  769. .title-txt {
  770. font-size: 15px;
  771. font-weight: bold;
  772. color: black;
  773. }
  774. .content-txt {
  775. font-size: 10px;
  776. font-weight: bold;
  777. color: black;
  778. }
  779. .background {
  780. // border: 15px solid hsla(0, 0%, 100%, .5);
  781. background: white;
  782. background-clip: padding-box;
  783. padding: 20rpx;
  784. border-radius: 20rpx;
  785. margin: 20rpx;
  786. /*从padding开始往外面裁剪背景*/
  787. }
  788. .uni-list-cell {
  789. position: relative;
  790. display: flex;
  791. flex-direction: row;
  792. justify-content: space-between;
  793. align-items: center;
  794. }
  795. .uni-list-cell-left {
  796. white-space: nowrap;
  797. font-size: 28rpx;
  798. }
  799. .centered {
  800. text-align: center;
  801. background-color: #e2f4ff;
  802. }
  803. .text {
  804. background-color: #e2f4ff;
  805. height: 20rpx;
  806. }
  807. .view_bg_build {
  808. background-color: #e2f4ff;
  809. padding: 10rpx;
  810. margin: 20rpx;
  811. }
  812. .grid-text {
  813. font-size: 14px;
  814. color: #000000;
  815. text-align: center;
  816. padding-left: 30rpx;
  817. padding-right: 30rpx;
  818. padding-top: 20rpx;
  819. padding-bottom: 20rpx;
  820. }
  821. .name {
  822. flex: 0;
  823. font-size: 14px;
  824. color: #000000;
  825. overflow: hidden;
  826. text-overflow: ellipsis;
  827. white-space: nowrap;
  828. }
  829. .table-item {
  830. overflow: hidden;
  831. text-overflow: ellipsis;
  832. white-space: nowrap;
  833. }
  834. .block-iv {
  835. width: 10px;
  836. height: 10px;
  837. }
  838. .btn {
  839. width: 715rpx;
  840. height: 69rpx;
  841. background: #79A4F0;
  842. border-radius: 6rpx;
  843. font-size: 25rpx;
  844. font-family: Microsoft YaHei;
  845. font-weight: 400;
  846. color: #FFFFFF;
  847. line-height: 69rpx;
  848. margin-top: 40rpx;
  849. margin-bottom: 100rpx;
  850. }
  851. .number {
  852. display: flex;
  853. /* 水平居中显示子元素 */
  854. align-items: flex-start;
  855. /* 垂直居中显示子元素 */
  856. justify-content: space-between;
  857. /* 左右间距等于间距大小 */
  858. padding: 10px;
  859. /* 设置padding以提高视觉效果 */
  860. }
  861. .tj-btn {
  862. height: 69rpx;
  863. background: #3184f0;
  864. border-radius: 6rpx;
  865. font-size: 25rpx;
  866. font-weight: 400;
  867. color: #FFFFFF;
  868. line-height: 69rpx;
  869. margin: 40rpx 70rpx;
  870. }
  871. .sc-btn {
  872. height: 69rpx;
  873. background: #f0686b;
  874. border-radius: 6rpx;
  875. font-size: 25rpx;
  876. font-weight: 400;
  877. color: #FFFFFF;
  878. line-height: 69rpx;
  879. margin: 40rpx;
  880. }
  881. .num-style {
  882. background: #e8f4f9;
  883. margin: 20rpx;
  884. padding: 10rpx;
  885. border-radius: 20rpx;
  886. border: 1px solid #d4e3f0;
  887. }
  888. .textarea {
  889. margin-top: 10upx;
  890. width: 100%;
  891. border: 1rpx solid red;
  892. min-height: 100upx;
  893. line-height: 20px;
  894. }
  895. .text {
  896. font-size: 16px;
  897. color: #333;
  898. }
  899. input {
  900. flex-grow: 1;
  901. font-size: 28rpx;
  902. color: #808080;
  903. }
  904. </style>