dangerous.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037
  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. console.log("复制")
  377. if (!_this.isEmpty(_this.fileUrl)) {
  378. console.log(_this.fileUrl)
  379. console.log(_this.fileName)
  380. uni.setClipboardData({
  381. data: _this.fileUrl,
  382. success() {
  383. uni.showToast({
  384. title: '已复制' + _this.fileName + '地址成功 请在浏览器打开',
  385. icon: 'none'
  386. });
  387. },
  388. fail(e) {
  389. console.log("失败", e)
  390. uni.showToast({
  391. title: '复制失败',
  392. icon: 'none'
  393. });
  394. }
  395. });
  396. }
  397. },
  398. //确定按钮
  399. confirm_loding() {
  400. this.show_loding = false;
  401. this.download(this.fileUrl, this.fileName);
  402. },
  403. getDownLoadFilePath() {
  404. let cachePath = `${uni.env.USER_DATA_PATH}/downloads`
  405. let fm = uni.getFileSystemManager()
  406. try {
  407. // 访问成功则存在
  408. fm.accessSync(cachePath)
  409. } catch (error) {
  410. // 不存在则新建
  411. fm.mkdirSync(cachePath, true)
  412. }
  413. return cachePath
  414. },
  415. download(url, name) {
  416. let savePath = this.getDownLoadFilePath();
  417. console.log('点击下载', url);
  418. console.log('点击下载333', savePath);
  419. //var savePath = uni.env.USER_DATA_PATH + '/savePath'
  420. uni.downloadFile({
  421. url: url,
  422. success: response => {
  423. if (response.statusCode === 200) {
  424. uni.getFileSystemManager().saveFile({
  425. tempFilePath: response.tempFilePath,
  426. filePath: `${savePath}/${name}`,
  427. success: (resData) => {
  428. console.log('保存路径', resData.savedFilePath)
  429. uni.showToast({
  430. title: '下载成功'
  431. })
  432. },
  433. fail: error => {
  434. console.log('error: ', error)
  435. }
  436. })
  437. }
  438. }
  439. })
  440. },
  441. showPhoto(index, list) {
  442. uni.previewImage({
  443. current: index,
  444. urls: list,
  445. })
  446. },
  447. pickerShow(e) {
  448. if (e == 'name') {
  449. this.open = true;
  450. let param = {};
  451. getDangerousWorkProjectList(param).then(res => {
  452. this.rows = res.data;
  453. })
  454. }
  455. },
  456. changeSelect(e) {
  457. },
  458. close() {
  459. this.open = false;
  460. },
  461. projectListSelect(item, index) {
  462. this.open = false;
  463. getDangerousWorkProjectDetails(item.id).then(res => {
  464. this.projectObj = res.data;
  465. this.projectTime = this.projectObj.enginTime;
  466. // if (this.isEmpty(this.projectTime)) {
  467. // this.projectTime = this.currentTime;
  468. // this.projectObj.enginTime = this.currentTime;
  469. // }
  470. this.isNeedSupport = this.projectObj.needSupport == "1";
  471. if (this.isNeedSupport) {
  472. this.needSupportText = "是";
  473. this.projectObj.needSupport = "1";
  474. } else {
  475. this.needSupportText = "否";
  476. this.projectObj.needSupport = "0";
  477. }
  478. this.isBushing = this.projectObj.casingPresent == "1";
  479. if (this.isBushing) {
  480. this.bushingText = "是";
  481. this.projectObj.casingPresent = "1";
  482. } else {
  483. this.bushingText = "否";
  484. this.projectObj.casingPresent = "0";
  485. }
  486. this.fileArr = this.projectObj.pics;
  487. for (let i = 0; i < this.fileArr.length; i++) {
  488. if (this.fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 3) == 'png' || this
  489. .fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 3) == 'jpg' ||
  490. this.fileArr[i].picUrl.substring(this.fileArr[i].picUrl.length - 4) ==
  491. 'jpeg') {
  492. this.imgList.push(this.fileArr[i].picUrl);
  493. }
  494. }
  495. })
  496. },
  497. switchChangePipe(e) {
  498. this.isBushing = e.detail.value;
  499. if (this.isBushing) {
  500. this.projectObj.casingPresent = "1";
  501. this.bushingText = "是";
  502. } else {
  503. this.projectObj.casingPresent = "0";
  504. this.bushingText = "否";
  505. }
  506. console.log("bush:" + this.isBushing + this.bushingText)
  507. },
  508. switchChangeSupport(e) {
  509. this.isNeedSupport = e.detail.value;
  510. if (this.isNeedSupport) {
  511. this.projectObj.needSupport = "1";
  512. this.needSupportText = "是";
  513. } else {
  514. this.projectObj.needSupport = "0";
  515. this.needSupportText = "否";
  516. }
  517. console.log("bush:" + this.isNeedSupport + this.needSupportText)
  518. },
  519. chooseFile() {
  520. if (this.isEmpty(this.projectObj.id)) {
  521. this.$modal.msg('请选择工程')
  522. return;
  523. }
  524. let _this = this;
  525. console.log('文件' + _this.headers);
  526. uni.chooseMessageFile({
  527. // sizeType: ['album', 'camera'],
  528. type: 'all',
  529. // extension: ['dwg', 'dwt', 'doc', 'docx', 'xls', 'xlsx', 'jpg', 'png', 'jpeg', 'mp4'],
  530. success(resp) {
  531. resp.tempFiles.forEach((item, index) => {
  532. const task = uni.uploadFile({
  533. url: _this.$HTTP + `/obs`,
  534. filePath: item.path,
  535. name: 'file',
  536. formData: {},
  537. header: _this.headers,
  538. success: res => {
  539. // 判断是否json字符串,将其转为json格式
  540. // console.log("结果", res)
  541. let data = JSON.parse(res.data);
  542. if (![200].includes(data.code)) {
  543. _this.$modal.msg(data.msg)
  544. } else {
  545. if (_this.progress === 100) {
  546. console.log(
  547. '_this.progress',
  548. _this.progress)
  549. console.log('res--', res)
  550. _this.fileArr.push({
  551. 'fileName': item
  552. .name,
  553. 'picUrl': data
  554. .data.url,
  555. })
  556. _this.$modal.msg('上传成功!')
  557. }
  558. }
  559. },
  560. fail: e => {
  561. console.log(e)
  562. _this.$modal.msg('上传失败!')
  563. //_this.uploadError(index, e);
  564. },
  565. complete: res => {
  566. uni.hideLoading();
  567. _this.uploading = false;
  568. }
  569. });
  570. task.onProgressUpdate(res => {
  571. _this.progress = res.progress;
  572. console.log('onProgressUpdate', res)
  573. console.log('task.onProgressUpdate', _this
  574. .progress)
  575. uni.showLoading({
  576. title: '上传中'
  577. })
  578. if (_this.progress != 100) {
  579. _this.loading = false
  580. console.log('_this.loading false',
  581. _this.loading)
  582. } else {
  583. _this.loading = true
  584. console.log('_this.loading true', _this
  585. .loading)
  586. }
  587. });
  588. })
  589. },
  590. })
  591. },
  592. isShowRemoveFile(item) {
  593. var isShow = item.createBy == this.$user.state.name;
  594. console.log("isShow:" + isShow + "_name:" + this.$user.state.name + "_createBy:" +
  595. item.createBy)
  596. return isShow;
  597. },
  598. removeFile(index) {
  599. uni.showModal({
  600. title: '提示',
  601. content: '是否删除该文件?',
  602. success: (res) => {
  603. if (res.confirm) {
  604. this.fileArr.splice(index, 1)
  605. console.log('this.fileArr', this.fileArr)
  606. }
  607. }
  608. })
  609. },
  610. submit() {
  611. if (this.isEmpty(this.projectObj.pipeDiameter)) {
  612. this.$modal.msg('请输入管径')
  613. return;
  614. }
  615. if (this.isEmpty(this.projectObj.tubularProduct)) {
  616. this.$modal.msg('请输入管材')
  617. return;
  618. }
  619. if (this.isEmpty(this.projectObj.pipePressure)) {
  620. this.$modal.msg('请输入管道压力')
  621. return;
  622. }
  623. if (this.isEmpty(this.projectObj.gasSourceDirection)) {
  624. this.$modal.msg('请输入气源方向')
  625. return;
  626. }
  627. if (this.isEmpty(this.projectObj.taskPosition)) {
  628. this.$modal.msg('请输入作业位置')
  629. return;
  630. }
  631. if (this.isEmpty(this.projectObj.valvePosition)) {
  632. this.$modal.msg('请输入作业相关阀门位置')
  633. return;
  634. }
  635. if (this.isEmpty(this.projectObj.stressReport)) {
  636. this.$modal.msg('请输入压力报告')
  637. return;
  638. }
  639. if (this.isEmpty(this.projectObj.supervisionRecord)) {
  640. this.$modal.msg('请输入监理旁站记录')
  641. return;
  642. }
  643. if (this.isEmpty(this.projectObj.workContactForm)) {
  644. this.$modal.msg('请输入工作联系单')
  645. return;
  646. }
  647. if (this.isEmpty(this.projectObj.linePatrolConfirmationForm)) {
  648. this.$modal.msg('请输入巡线确认单')
  649. return;
  650. }
  651. if (this.isEmpty(this.projectObj.hazardousWorkPitsLong)) {
  652. this.$modal.msg('请输入危险作业坑长度')
  653. return;
  654. }
  655. if (this.isEmpty(this.projectObj.hazardousWorkPitsWide)) {
  656. this.$modal.msg('请输入危险作业坑宽度')
  657. return;
  658. }
  659. if (this.isEmpty(this.projectObj.hazardousWorkPitsDeep)) {
  660. this.$modal.msg('请输入危险作业坑深度')
  661. return;
  662. }
  663. if (this.isEmpty(this.projectObj.otherPipelineConditionsWorkPit)) {
  664. this.$modal.msg('请输入作业坑内其他管道情况')
  665. return;
  666. }
  667. if (this.isEmpty(this.projectObj.siteHead)) {
  668. this.$modal.msg('请输入现场负责人')
  669. return;
  670. }
  671. if (this.isEmpty(this.projectObj.siteHeadPhone)) {
  672. this.$modal.msg('请输入现场负责人联系方式')
  673. return;
  674. } else {
  675. if (!this.$validation.mobile(this.projectObj.siteHeadPhone)) {
  676. this.$modal.msg('请输入正确的联系方式');
  677. return;
  678. }
  679. }
  680. if (this.isEmpty(this.projectObj.operatorInformation)) {
  681. this.$modal.msg('请输入作业人员信息')
  682. return;
  683. }
  684. if (this.isEmpty(this.projectObj.inspectionPort)) {
  685. this.$modal.msg('请输入检口')
  686. return;
  687. }
  688. if (this.isEmpty(this.projectObj.pipelinePainting)) {
  689. this.$modal.msg('请输入管道刷油')
  690. return;
  691. }
  692. if (this.isEmpty(this.projectObj.pipelineCorrosionProtection)) {
  693. this.$modal.msg('请输入管道防腐')
  694. return;
  695. }
  696. if (this.isEmpty(this.projectObj.pipelineSupport)) {
  697. this.$modal.msg('请输入管道支护')
  698. return;
  699. }
  700. if (this.isEmpty(this.projectObj.masonryValveWell)) {
  701. this.$modal.msg('请输入砌筑阀门井')
  702. return;
  703. }
  704. if (this.isEmpty(this.projectObj.protectionWell)) {
  705. this.$modal.msg('请输入保护井')
  706. return;
  707. }
  708. if (this.isEmpty(this.projectObj.pipeProtectionWelMasonry)) {
  709. this.$modal.msg('请输入管件保护井砌筑')
  710. return;
  711. }
  712. if (this.isEmpty(this.projectObj.backfill)) {
  713. this.$modal.msg('请输入回填')
  714. return;
  715. }
  716. if (this.isEmpty(this.projectObj.tamp)) {
  717. this.$modal.msg('请输入夯实')
  718. return;
  719. }
  720. if (this.isEmpty(this.projectObj.levelingTheSite)) {
  721. this.$modal.msg('请输入平整场地')
  722. return;
  723. }
  724. if (this.isEmpty(this.projectObj.remark)) {
  725. this.$modal.msg('请输入备注')
  726. return;
  727. }
  728. if (this.fileArr.length <= 0) {
  729. this.$modal.msg('请选择附件')
  730. return;
  731. }
  732. this.projectObj.enginTime = this.projectTime;
  733. this.projectObj.pics = this.fileArr;
  734. updateDangerousWorkProject(this.projectObj).then(res => {
  735. this.$modal.msg(res.msg);
  736. setTimeout(() => {
  737. uni.navigateBack();
  738. }, 1000);
  739. })
  740. },
  741. handleSubmit(e) {
  742. this.projectTime =
  743. `${e.year}-${e.month}-${e.day} ${e.hour}:${e.minute}:${e.second}`;
  744. this.projectObj.enginTime = this.projectTime;
  745. },
  746. // 打开picker
  747. openDatetimePicker() {
  748. if (this.isEmpty(this.projectObj.id)) {
  749. this.$modal.msg('请选择工程')
  750. } else {
  751. this.$refs.myPicker.show();
  752. }
  753. },
  754. addTimes(m) {
  755. return m < 10 ? '0' + m : m
  756. },
  757. //获取当前时间
  758. traversalTime(timestamp) {
  759. //timestamp(时间戳)是整数,否则要parseInt转换
  760. let time = new Date(timestamp);
  761. let y = time.getFullYear();
  762. let m = time.getMonth() + 1;
  763. let d = time.getDate();
  764. let h = time.getHours();
  765. let mm = time.getMinutes();
  766. let s = time.getSeconds();
  767. return y + '-' + this.addTimes(m) + '-' + this.addTimes(d) + ' ' + this.addTimes(
  768. h) + ':' + this.addTimes(
  769. mm) + ':' + this.addTimes(s);
  770. },
  771. }
  772. }
  773. </script>
  774. <style>
  775. .container {
  776. display: flex;
  777. align-items: center;
  778. justify-content: space-between;
  779. padding: 10px;
  780. position: relative;
  781. }
  782. .uni-list {
  783. border: 1xp solid #eee;
  784. }
  785. .to-right-icon {
  786. width: 15px;
  787. height: 15px;
  788. position: absolute;
  789. top: 50%;
  790. transform: translateY(-50%);
  791. }
  792. .marginLeft5 {
  793. margin-left: 5px;
  794. }
  795. .title-txt {
  796. font-size: 15px;
  797. font-weight: bold;
  798. color: black;
  799. }
  800. .content-txt {
  801. font-size: 10px;
  802. font-weight: bold;
  803. color: black;
  804. }
  805. .background {
  806. // border: 15px solid hsla(0, 0%, 100%, .5);
  807. background: white;
  808. background-clip: padding-box;
  809. padding: 20rpx;
  810. border-radius: 20rpx;
  811. margin: 20rpx;
  812. /*从padding开始往外面裁剪背景*/
  813. }
  814. .uni-list-cell {
  815. position: relative;
  816. display: flex;
  817. flex-direction: row;
  818. justify-content: space-between;
  819. align-items: center;
  820. }
  821. .uni-list-cell-left {
  822. white-space: nowrap;
  823. font-size: 28rpx;
  824. }
  825. .centered {
  826. text-align: center;
  827. background-color: #e2f4ff;
  828. }
  829. .text {
  830. background-color: #e2f4ff;
  831. height: 20rpx;
  832. }
  833. .view_bg_build {
  834. background-color: #e2f4ff;
  835. padding: 10rpx;
  836. margin: 20rpx;
  837. }
  838. .grid-text {
  839. font-size: 14px;
  840. color: #000000;
  841. text-align: center;
  842. padding-left: 30rpx;
  843. padding-right: 30rpx;
  844. padding-top: 20rpx;
  845. padding-bottom: 20rpx;
  846. }
  847. .name {
  848. flex: 0;
  849. font-size: 14px;
  850. color: #000000;
  851. overflow: hidden;
  852. text-overflow: ellipsis;
  853. white-space: nowrap;
  854. }
  855. .table-item {
  856. overflow: hidden;
  857. text-overflow: ellipsis;
  858. white-space: nowrap;
  859. }
  860. .block-iv {
  861. width: 10px;
  862. height: 10px;
  863. }
  864. .btn {
  865. width: 715rpx;
  866. height: 69rpx;
  867. background: #79A4F0;
  868. border-radius: 6rpx;
  869. font-size: 25rpx;
  870. font-family: Microsoft YaHei;
  871. font-weight: 400;
  872. color: #FFFFFF;
  873. line-height: 69rpx;
  874. margin-top: 40rpx;
  875. margin-bottom: 100rpx;
  876. }
  877. .number {
  878. display: flex;
  879. /* 水平居中显示子元素 */
  880. align-items: flex-start;
  881. /* 垂直居中显示子元素 */
  882. justify-content: space-between;
  883. /* 左右间距等于间距大小 */
  884. padding: 10px;
  885. /* 设置padding以提高视觉效果 */
  886. }
  887. .tj-btn {
  888. height: 69rpx;
  889. background: #3184f0;
  890. border-radius: 6rpx;
  891. font-size: 25rpx;
  892. font-weight: 400;
  893. color: #FFFFFF;
  894. line-height: 69rpx;
  895. margin: 40rpx 70rpx;
  896. }
  897. .sc-btn {
  898. height: 69rpx;
  899. background: #f0686b;
  900. border-radius: 6rpx;
  901. font-size: 25rpx;
  902. font-weight: 400;
  903. color: #FFFFFF;
  904. line-height: 69rpx;
  905. margin: 40rpx;
  906. }
  907. .num-style {
  908. background: #e8f4f9;
  909. margin: 20rpx;
  910. padding: 10rpx;
  911. border-radius: 20rpx;
  912. border: 1px solid #d4e3f0;
  913. }
  914. .textarea {
  915. margin-top: 10upx;
  916. width: 100%;
  917. border: 1rpx solid red;
  918. min-height: 100upx;
  919. line-height: 20px;
  920. }
  921. .text {
  922. font-size: 16px;
  923. color: #333;
  924. }
  925. input {
  926. flex-grow: 1;
  927. font-size: 28rpx;
  928. color: #808080;
  929. }
  930. </style>