PressureRegulatingBox.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214
  1. <template>
  2. <view>
  3. <image src="/static/icon/background.png" class="background"></image>
  4. <view class="project-content">
  5. <u-form :model="form" ref="form">
  6. <view class="top">
  7. <u-icon class="top-icon" name="map-fill"></u-icon>
  8. <u-form-item label=" " borderBottom ref="item1" placeholder=" " labelWidth="20" label-align="left">
  9. <u-input v-model="communityName" disabled placeholder=" " disabled trim="false"></u-input>
  10. </u-form-item>
  11. <u-icon class="top-icon" name="calendar"></u-icon>
  12. <u-form-item label=" " borderBottom ref="item1" placeholder=" " labelWidth="20">
  13. <u-input v-model="time" disabled style="font-size: 2rpx" length='30px' trim="true"
  14. placeholder=" "></u-input>
  15. </u-form-item>
  16. </view>
  17. <view class="small-title">调压箱部分</view>
  18. <u-row gutter="12">
  19. <u-col>
  20. <u-form-item label="管理所" borderBottom ref="item1" labelWidth="140">
  21. <u-input v-model="AdministrativeOfficeLabel" placeholder="请输入管理所名称"
  22. disabled borderBottom @click="showadministrativeOffice= true&&type!=1"></u-input>
  23. <u-select v-model="showadministrativeOffice" :list="AdministrativeOfficeList" label-name="name"
  24. value-name="value" @confirm="AdministrativeOffice()"> </u-select>
  25. <u-icon slot="right" name="arrow-right"></u-icon>
  26. </u-form-item>
  27. </u-col>
  28. <u-col>
  29. <u-form-item label="编号" borderBottom ref="item1" labelWidth="140">
  30. <u-input :disabled="type==1" v-model="form.number" placeholder="请输入编号" ></u-input>
  31. </u-form-item>
  32. </u-col>
  33. <u-col>
  34. <u-form-item label="商服" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  35. <u-radio-group v-model="form.businessService" :disabled="type==1">
  36. <u-radio @change="businessService" v-for="(item, index) in typelist.business_service" :key="index"
  37. :name="item.dictValue">
  38. {{item.dictLabel}}
  39. </u-radio>
  40. </u-radio-group>
  41. </u-form-item>
  42. </u-col>
  43. <u-col>
  44. <u-form-item label="外观" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  45. <u-radio-group v-model="form.appearance" :disabled="type==1">
  46. <u-radio @change="appearance" v-for="(item, index) in typelist.appearance" :key="index"
  47. :name="item.dictValue">
  48. {{item.dictLabel}}
  49. </u-radio>
  50. </u-radio-group>
  51. </u-form-item>
  52. </u-col>
  53. <u-col>
  54. <u-form-item label="方砖" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  55. <u-radio-group v-model="form.squareBrick" :disabled="type==1">
  56. <u-radio @change="squareBrick" v-for="(item, index) in typelist.square_brick"
  57. :key="index" :name="item.dictValue">
  58. {{item.dictLabel}}
  59. </u-radio>
  60. </u-radio-group>
  61. </u-form-item>
  62. </u-col>
  63. <u-col>
  64. <u-form-item label="护栏" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  65. <u-radio-group v-model="form.guardrail" :disabled="type==1">
  66. <u-radio @change="guardrail" v-for="(item, index) in typelist.guardrail" :key="index"
  67. :name="item.dictValue">
  68. {{item.dictLabel}}
  69. </u-radio>
  70. </u-radio-group>
  71. </u-form-item>
  72. </u-col>
  73. <u-col>
  74. <u-form-item label="基础" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  75. <u-radio-group v-model="form.foundation" :disabled="type==1">
  76. <u-radio @change="foundation" v-for="(item, index) in typelist.foundation" :key="index"
  77. :name="item.dictValue">
  78. {{item.dictLabel}}
  79. </u-radio>
  80. </u-radio-group>
  81. </u-form-item>
  82. </u-col>
  83. <u-col>
  84. <u-form-item label="压力表" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  85. <u-radio-group v-model="form.pressureGage" :disabled="type==1">
  86. <u-radio @change="pressureGage" v-for="(item, index) in typelist.pressure_gage"
  87. :key="index" :name="item.dictValue">
  88. {{item.dictLabel}}
  89. </u-radio>
  90. </u-radio-group>
  91. </u-form-item>
  92. </u-col>
  93. <u-col>
  94. <u-form-item label="阀门" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  95. <u-radio-group v-model="form.valve" :disabled="type==1">
  96. <u-radio @change="valve" v-for="(item, index) in typelist.valve" :key="index"
  97. :name="item.dictValue">
  98. {{item.dictLabel}}
  99. </u-radio>
  100. </u-radio-group>
  101. </u-form-item>
  102. </u-col>
  103. <u-col>
  104. <u-form-item label="是否泄露" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  105. <u-radio-group v-model="form.isThereALeak" :disabled="type==1">
  106. <u-radio @change="isThereALeak" v-for="(item, index) in typelist.yes_and_no"
  107. :key="index" :name="item.dictValue">
  108. {{item.dictLabel}}
  109. </u-radio>
  110. </u-radio-group>
  111. </u-form-item>
  112. </u-col>
  113. <u-col>
  114. <u-form-item label="调压器" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  115. <u-radio-group v-model="form.voltageRegulator" :disabled="type==1">
  116. <u-radio @change="voltageRegulator" v-for="(item, index) in typelist.voltage_regulator"
  117. :key="index" :name="item.dictValue">
  118. {{item.dictLabel}}
  119. </u-radio>
  120. </u-radio-group>
  121. </u-form-item>
  122. </u-col>
  123. <u-col>
  124. <u-form-item label="过滤器" borderBottom ref="item1" placeholder="请输入编号" labelWidth="120">
  125. <u-radio-group v-model="form.filter" :disabled="type==1">
  126. <u-radio @change="filter" v-for="(item, index) in typelist.filter" :key="index"
  127. :name="item.dictValue">
  128. {{item.dictLabel}}
  129. </u-radio>
  130. </u-radio-group>
  131. </u-form-item>
  132. </u-col>
  133. </u-row>
  134. <u-row class="un-row" gutter="12" style="text-align:left;">
  135. <u-col span="10">
  136. <u-form-item label="入口压力" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  137. <u-input v-model="form.inletPressure" length='20px' placeholder="请输入入口压力"
  138. :disabled="type==1" type="digit" :clearable="false" @input="checkinletPressure"></u-input>
  139. </u-form-item>
  140. </u-col>
  141. <u-col span="2">
  142. <viwe class="danwei">Mpa</viwe>
  143. </u-col>
  144. </u-row>
  145. <u-row gutter="12">
  146. <u-col span="5">
  147. <u-form-item label="出口压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200">
  148. <u-input v-model="form.exportPressureMain" placeholder=" " :disabled="type==1" type="digit" :clearable="false" @input="checkexportPressureMain"></u-input>
  149. </u-form-item>
  150. </u-col>
  151. <u-col span="2">
  152. <viwe class="danwei">KPa</viwe>
  153. </u-col>
  154. <u-col span="3">
  155. <u-form-item label="副路" borderBottom ref="item1" placeholder=" " labelWidth="80">
  156. <u-input v-model="form.exportPressureAccessory" length='20px' trim="false" aceholder=""
  157. :disabled="type==1" type="digit" :clearable="false" @input="checkexportPressureAccessory"></u-input>
  158. </u-form-item>
  159. </u-col>
  160. <u-col span="1">
  161. <viwe class="danwei">KPa</viwe>
  162. </u-col>
  163. </u-row>
  164. <u-row gutter="12">
  165. <u-col span="5">
  166. <u-form-item label="关闭压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200">
  167. <u-input v-model="form.closingPressureMain" placeholder=" " trim="false"
  168. :disabled="type==1" type="digit" :clearable="false" @input="checkclosingPressureMain"></u-input>
  169. </u-form-item>
  170. </u-col>
  171. <u-col span="2">
  172. <viwe class="danwei">KPa</viwe>
  173. </u-col>
  174. <u-col span="3">
  175. <u-form-item label="副路" borderBottom ref="item1" placeholder=" " labelWidth="80">
  176. <u-input v-model="form.closingPressureAccessory" length='20px' trim="false" placeholder=" "
  177. :disabled="type==1" type="digit" :clearable="false" @input="checkclosingPressureAccessory"></u-input>
  178. </u-form-item>
  179. </u-col>
  180. <u-col span="1">
  181. <viwe class="danwei">KPa</viwe>
  182. </u-col>
  183. </u-row>
  184. <u-row>
  185. <u-col>
  186. <u-form-item label="伴热带" labelWidth="140" borderBottom ref="item1">
  187. <u-radio-group v-model="form.xtv" :disabled="type==1">
  188. <u-radio @change="xtv"
  189. v-for="(item, index) in typelist.xtv" :key="index"
  190. :name="item.dictValue">
  191. {{item.dictLabel}}
  192. </u-radio>
  193. </u-radio-group>
  194. </u-form-item>
  195. </u-col>
  196. <u-col>
  197. <u-form-item label="有无温控器" borderBottom ref="item1" placeholder="" labelWidth="180">
  198. <u-radio-group v-model="form.thermostat" :disabled="type==1">
  199. <u-radio @change="thermostat"
  200. v-for="(item, index) in typelist.yes_or_no" :key="index"
  201. :name="item.dictValue">
  202. {{item.dictLabel}}
  203. </u-radio>
  204. </u-radio-group>
  205. </u-form-item>
  206. </u-col>
  207. <u-col>
  208. <u-form-item label="有无防爆开关" borderBottom ref="item1" placeholder="" labelWidth="180">
  209. <u-radio-group v-model="form.explosionProofSwitch" :disabled="type==1">
  210. <u-radio @change="explosionProofSwitch"
  211. v-for="(item, index) in typelist.yes_or_no" :key="index"
  212. :name="item.dictValue">
  213. {{item.dictLabel}}
  214. </u-radio>
  215. </u-radio-group>
  216. </u-form-item>
  217. </u-col>
  218. </u-row>
  219. <view class="small-title">切断器测证部分</view>
  220. <u-row>
  221. <u-col>
  222. <u-form-item label="切断器测试" borderBottom ref="item1" placeholder="" labelWidth="200">
  223. <u-radio-group v-model="form.cutterTested" :disabled="type==1">
  224. <u-radio @change="cutterTested"
  225. v-for="(item, index) in typelist.cutoff_test_certification" :key="index"
  226. :name="item.dictValue">
  227. {{item.dictLabel}}
  228. </u-radio>
  229. </u-radio-group>
  230. </u-form-item>
  231. </u-col>
  232. <u-col>
  233. <u-form-item label="切断器(放散阀)测试情况" borderBottom ref="item1" placeholder="" labelWidth="320" v-if="form.cutterTested==1">
  234. <u-radio-group v-model="form.disconnectorTestStatus" :disabled="type==1">
  235. <u-radio @change="disconnectorTestStatus"
  236. v-for="(item, index) in typelist.disconnector_test_status" :key="index"
  237. :name="item.dictValue">
  238. {{item.dictLabel}}
  239. </u-radio>
  240. </u-radio-group>
  241. </u-form-item>
  242. </u-col>
  243. </u-row>
  244. <u-row gutter="12">
  245. <u-col span="5">
  246. <u-form-item label="切断压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200" v-if="form.cutterTested==1">
  247. <u-input v-model="form.cutOffPressureMain" placeholder=" " :disabled="type==1" type="digit" :clearable="false" @input="checkcutOffPressureMain"></u-input>
  248. </u-form-item>
  249. </u-col>
  250. <u-col span="2" v-if="form.cutterTested==1">
  251. <viwe class="danwei" >KPa</viwe>
  252. </u-col>
  253. <u-col span="3">
  254. <u-form-item label="副路" borderBottom ref="item1" placeholder="" labelWidth="80" v-if="form.cutterTested==1">
  255. <u-input v-model="form.cutOffPressureAccessory" length='20px' placeholder="请输入副路"
  256. :disabled="type==1" type="digit" :clearable="false" @input="checkcutOffPressureAccessory"></u-input>
  257. </u-form-item>
  258. </u-col>
  259. <u-col span="1" v-if="form.cutterTested==1">
  260. <viwe class="danwei">KPa</viwe>
  261. </u-col>
  262. </u-row>
  263. <u-row gutter="12" style="text-align: center;">
  264. <u-col span="10">
  265. <u-form-item label="放散压力" borderBottom ref="item1" placeholder="请输入放散压力" labelWidth="140" v-if="form.cutterTested==1">
  266. <u-input v-model="form.releasePressure" length='20px' placeholder="请输入放散压力"
  267. :disabled="type==1" type="digit" :clearable="false" @input="checkreleasePressure"></u-input>
  268. </u-form-item>
  269. </u-col>
  270. <u-col span="2" v-if="form.cutterTested==1">
  271. <viwe class="danwei" >Mpa</viwe>
  272. </u-col>
  273. </u-row>
  274. <view class="small-title">主副路交替部分</view>
  275. <u-row>
  276. <u-col>
  277. <u-form-item label="是否交替" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
  278. <u-radio-group v-model="form.manOfAccessoryAlternating" :disabled="type==1">
  279. <u-radio @change="manOfAccessoryAlternating" v-for="(item, index) in typelist.secondary_roads" :key="index"
  280. :name="item.dictValue">
  281. {{item.dictLabel}}
  282. </u-radio>
  283. </u-radio-group>
  284. </u-form-item>
  285. </u-col>
  286. </u-row>
  287. <u-row gutter="12" style="text-align: center;" v-if="form.manOfAccessoryAlternating==1">
  288. <u-col span="12">
  289. <u-form-item label="操作结果主副路已交替完毕,现" borderBottom ref="item1" placeholder="请输入编号"
  290. labelWidth="420">
  291. <u-input v-model="form.mainRoad" length='20px' placeholder="请输入"
  292. :disabled="type==1"></u-input>
  293. </u-form-item>
  294. </u-col>
  295. <u-col span="12">
  296. <viwe class="danwei">路为主路</viwe>
  297. </u-col>
  298. </u-row>
  299. <view class="small-title">特殊情况说明</view>
  300. <u-row>
  301. <u-col>
  302. <u-form-item label="调压设施特例" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
  303. <u-radio-group v-model="form.specialCaseOfPressureRegulatingFacilities" :disabled="type==1">
  304. <u-radio @change="specialCaseOfPressureRegulatingFacilities"
  305. v-for="(item, index) in typelist.special_case_of_pressure_regulating_facilities"
  306. :key="index" :name="item.dictValue">
  307. {{item.dictLabel}}
  308. </u-radio>
  309. </u-radio-group>
  310. </u-form-item>
  311. </u-col>
  312. <u-col>
  313. <u-form-item label="超期巡检天数" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
  314. <u-radio-group v-model="form.overdueInspectionDays" :disabled="type==1">
  315. <u-radio @change="overdueInspectionDays"
  316. v-for="(item, index) in typelist.overdue_inspection_days" :key="index"
  317. :name="item.dictValue">
  318. {{item.dictLabel}}
  319. </u-radio>
  320. </u-radio-group>
  321. </u-form-item>
  322. </u-col>
  323. <!-- <u-col>
  324. <u-form-item label="超期巡检原因" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
  325. <u-radio-group v-model="form.reasonForOverdueInspection" :disabled="type==1">
  326. <u-radio @change="reasonForOverdueInspection"
  327. v-for="(item, index) in typelist.reason_for_overdue_inspection" :key="index"
  328. :name="item.dictValue">
  329. {{item.dictLabel}}
  330. </u-radio>
  331. </u-radio-group>
  332. </u-form-item>
  333. </u-col> -->
  334. <u-col>
  335. <u-form-item label="超期巡检原因" borderBottom ref="item1" labelWidth="200" v-if="form.overdueInspectionDays!=undefined&&form.overdueInspectionDays!=3">
  336. <u-input v-model="form.reasonForOverdueInspection" placeholder="请输入超期巡检原因"
  337. :disabled="type==1"></u-input>
  338. </u-form-item>
  339. </u-col>
  340. </u-row>
  341. <!-- <view class="small-title">阀井测试部分</view>
  342. <u-row>
  343. <u-col>
  344. <u-form-item label="未测试" borderBottom ref="item1" placeholder="请输入编号" labelWidth="120">
  345. <u-switch v-model="form.valveWellTesting" :disabled="type==1"></u-switch>
  346. </u-form-item>
  347. </u-col>
  348. <u-col>
  349. <u-form-item label="阀井情况" labelWidth="140" borderBottom ref="item1">
  350. <u-input v-model="valveWellConditioLabel" disabled
  351. @click=" showvalveWellCondition= true&& type!=1" borderBottom
  352. placeholder="请选择阀井情况"></u-input>
  353. <u-select v-model="showvalveWellCondition" :list="typelist.valve_well_condition"
  354. @confirm="valveWellCondition()" label-name="dictLabel" value-name="dictValue">
  355. </u-select>
  356. <u-icon slot="right" name="arrow-right"></u-icon>
  357. </u-form-item>
  358. </u-col>
  359. </u-row> -->
  360. <view class="small-title">备注信息</view>
  361. <u-row>
  362. <u-col>
  363. <u-form-item label=" " labelWidth="0" borderBottom ref="item1">
  364. <u-input v-model="form.remarks" type="textarea" borderBottom placeholder="请填写备注信息内容"
  365. :disabled="type==1"></u-input>
  366. </u-form-item>
  367. </u-col>
  368. <u-col>
  369. <u-form-item label=" " labelWidth="0" borderBottom ref="item1">
  370. <u-input v-model="form.WarningColumnInformation" disabled placeholder="请上传巡检照片"></u-input>
  371. <view class="" style="display: flex; flex-wrap: wrap; margin: 0 55rpx;">
  372. <image src="/static/icon/chooseimg.png" mode=""
  373. style="width: 190rpx; height: 190rpx; margin: 0 12rpx; " @click="choose()"
  374. v-if="type!=1"></image>
  375. <view v-for="(item,index) in imgymxs" :key="index" style="position: relative;">
  376. <view v-if="item.type == 'image'">
  377. <image :src="item.url" mode=""
  378. style="width: 190rpx; height: 190rpx; margin: 0 20rpx;"
  379. @click="showPhoto(index)">
  380. </image>
  381. </view>
  382. <view v-else>
  383. <video :src="item"
  384. style="width: 190rpx; height: 190rpx; margin: 0 20rpx;"></video>
  385. </view>
  386. <view @click="remove(index)" v-if="type!=1"
  387. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%; background-color: #FF0000;">
  388. <u-icon name="close" color="#FFFFFF" size="35" v-if="type!=1"></u-icon>
  389. </view>
  390. </view>
  391. </view>
  392. </u-form-item>
  393. </u-col>
  394. </u-row>
  395. </u-form>
  396. <u-button class="from-but" style="margin: 40rpx 0;" @click="save()" v-if="type!=1"
  397. type='primary'>确认上传</u-button>
  398. </view>
  399. </u-form>
  400. </view>
  401. </view>
  402. </template>
  403. <script>
  404. import service from '@/api/index.js'
  405. export default {
  406. data() {
  407. return {
  408. action: this.$HTTP.webUrl + `/obs`,
  409. headers: {
  410. MAuthorization: "wxBearer " + uni.getStorageSync('token')
  411. },
  412. url: [],
  413. showadministrativeOffice:false,
  414. uploading: false,
  415. imgArr: [],
  416. PhotoList: [],
  417. community: '',
  418. building: '',
  419. unit: '',
  420. imgymxs: [],
  421. progress: 0, //图片或视频上传百分比
  422. showxtv: false,
  423. showvalveWellCondition: false,
  424. form: {
  425. businessService:0,
  426. administrativeOffice:0,
  427. businessService:0,
  428. isNotXtv:0,
  429. appearance:0,
  430. squareBrick:0,
  431. foundation:0,
  432. pressureGage:0,
  433. valve:0,
  434. isThereALeak:0,
  435. voltageRegulator:0,
  436. xtv:0,
  437. thermostat:0,
  438. explosionProofSwitch:0,
  439. cutterTested:0,
  440. manOfAccessoryAlternating:0,
  441. filter:0,
  442. specialCaseOfPressureRegulatingFacilities:0,
  443. overdueInspectionDays:3,
  444. valveWellTesting:true,
  445. guardrail:0
  446. },
  447. xtvLabel: null,
  448. valveWellConditioLabel: null,
  449. // 表单校验
  450. rules: {
  451. areaId: [{
  452. required: true,
  453. message: "所属小区不能为空",
  454. trigger: "blur"
  455. }],
  456. buildingId: [{
  457. required: true,
  458. message: "所属楼宇不能为空",
  459. trigger: "blur"
  460. }],
  461. unitId: [{
  462. required: true,
  463. message: "单元id不能为空",
  464. trigger: "change"
  465. }],
  466. number: [{
  467. required: true,
  468. message: "编号不能为空",
  469. trigger: "blur"
  470. }],
  471. businessService: [{
  472. required: true,
  473. message: "商服不能为空",
  474. trigger: "blur"
  475. }],
  476. appearance: [{
  477. required: true,
  478. message: "外观不能为空",
  479. trigger: "change"
  480. }],
  481. squareBrick: [{
  482. required: true,
  483. message: "方砖不能为空",
  484. trigger: "change"
  485. }],
  486. guardrail: [{
  487. required: true,
  488. message: "护栏不能为空",
  489. trigger: "change"
  490. }],
  491. foundation: [{
  492. required: true,
  493. message: "基础不能为空",
  494. trigger: "change"
  495. }],
  496. pressureGage: [{
  497. required: true,
  498. message: "压力表不能为空",
  499. trigger: "change"
  500. }],
  501. mainRoad: [{
  502. required: true,
  503. message: "当前主路不能为空",
  504. trigger: "change"
  505. }],
  506. valve: [{
  507. required: true,
  508. message: "阀门不能为空",
  509. trigger: "change"
  510. }],
  511. isThereALeak: [{
  512. required: true,
  513. message: "是否泄露不能为空",
  514. trigger: "blur"
  515. }],
  516. voltageRegulator: [{
  517. required: true,
  518. message: "调压器不能为空",
  519. trigger: "change"
  520. }],
  521. inletPressure: [{
  522. required: true,
  523. message: "入口压力不能为空",
  524. trigger: "blur"
  525. }],
  526. exportPressureMain: [{
  527. required: true,
  528. message: "出口压力(主路)不能为空",
  529. trigger: "blur"
  530. }],
  531. exportPressureAccessory: [{
  532. required: true,
  533. message: "出口压力(副路)不能为空",
  534. trigger: "blur"
  535. }],
  536. closingPressureMain: [{
  537. required: true,
  538. message: "关闭压力(主路)不能为空",
  539. trigger: "blur"
  540. }],
  541. closingPressureAccessory: [{
  542. required: true,
  543. message: "关闭压力(副路)不能为空",
  544. trigger: "blur"
  545. }],
  546. xtv: [{
  547. required: true,
  548. message: "伴热带不能为空",
  549. trigger: "change"
  550. }],
  551. thermostat: [{
  552. required: true,
  553. message: "有无控温器不能为空",
  554. trigger: "blur"
  555. }],
  556. explosionProofSwitch: [{
  557. required: true,
  558. message: "有无防爆开关不能为空",
  559. trigger: "blur"
  560. }],
  561. cutterTested: [{
  562. required: true,
  563. message: "切断器测试不能为空",
  564. trigger: "blur"
  565. }],
  566. disconnectorTestStatus: [{
  567. required: true,
  568. message: "切断器(放散阀)测试情况不能为空",
  569. trigger: "change"
  570. }],
  571. cutOffPressureMain: [{
  572. required: true,
  573. message: "切断压力(主路)不能为空",
  574. trigger: "blur"
  575. }],
  576. cutOffPressureAccessory: [{
  577. required: true,
  578. message: "切断压力(副路)不能为空",
  579. trigger: "blur"
  580. }],
  581. releasePressure: [{
  582. required: true,
  583. message: "放散压力不能为空",
  584. trigger: "blur"
  585. }],
  586. manOfAccessoryAlternating: [{
  587. required: true,
  588. message: "主副路交替不能为空",
  589. trigger: "blur"
  590. }],
  591. filter: [{
  592. required: true,
  593. message: "过滤器不能为空",
  594. trigger: "change"
  595. }],
  596. specialCaseOfPressureRegulatingFacilities: [{
  597. required: true,
  598. message: "调压设施特例不能为空",
  599. trigger: "change"
  600. }],
  601. overdueInspectionDays: [{
  602. required: true,
  603. message: "超期巡检天数不能为空",
  604. trigger: "change"
  605. }],
  606. reasonForOverdueInspection: [{
  607. required: true,
  608. message: "超期巡检原因不能为空",
  609. trigger: "change"
  610. }],
  611. otherReasonsForOverdueInspection: [{
  612. required: true,
  613. message: "超期巡检其他原因不能为空",
  614. trigger: "blur"
  615. }],
  616. valveWellTesting: [{
  617. required: true,
  618. message: "阀井测试不能为空",
  619. trigger: "blur"
  620. }],
  621. valveWellCondition: [{
  622. required: true,
  623. message: "阀井情况不能为空",
  624. trigger: "change"
  625. }]
  626. },
  627. communityName: '',
  628. communityId:'',
  629. time: '',
  630. showrepairType: false,
  631. showrepairType: null,
  632. checked: true,
  633. typelist: {},
  634. dictlist: ['appearance', 'square_brick', 'guardrail', 'foundation', 'pressure_gage', 'valve',
  635. 'voltage_regulator', 'xtv', 'disconnector_test_status', 'filter','cutoff_test_certification','secondary_roads',
  636. 'special_case_of_pressure_regulating_facilities', 'overdue_inspection_days',
  637. 'reason_for_overdue_inspection', 'valve_well_condition', 'find_problem', 'xtv','administrative_office','yes_and_no','business_service','yes_or_no'
  638. ],
  639. type: 2,
  640. id: null,
  641. AdministrativeOfficeList:[],
  642. AdministrativeOfficeLabel:null,
  643. userId:null,createBy:null,
  644. administrativeOffice:null,
  645. code:null,
  646. name:null
  647. }
  648. },
  649. // onReady() {
  650. // uni.setNavigationBarTitle({
  651. // title: '调压箱表单'
  652. // });
  653. // },
  654. showPhoto(index) {
  655. uni.previewImage({
  656. current: index,
  657. urls: this.imgArr,
  658. })
  659. },
  660. showPhotos(index) {
  661. uni.previewImage({
  662. current: index,
  663. urls: this.photo,
  664. })
  665. },
  666. onLoad(e) {
  667. uni.setNavigationBarTitle({
  668. title: '调压箱表单'
  669. });
  670. uni.setNavigationBarColor({
  671. frontColor: '#ffffff',
  672. backgroundColor: '#2d95f4',
  673. })
  674. let time1 = new Date()
  675. console.log(time1.toLocaleString())
  676. var year = time1.getFullYear(); //得到年份
  677. var month = time1.getMonth() + 1; //得到月份
  678. var date = time1.getDate(); //得到日期
  679. var hours = time1.getHours(); //获取系统时
  680. var Min = time1.getMinutes(); //分
  681. this.type = e.type
  682. this.id = e.id
  683. this.time = year + "/" + month + "/" + date + "-" + hours + ":" + Min
  684. this.form.areaId = e.community
  685. this.communityId=e.community
  686. this.communityName = e.communityName
  687. // this.form.number=e.code
  688. // this.administrativeOffice=e.administrativeOffice
  689. // this.form.administrativeOffice=this.administrativeOffice
  690. this.name=e.name
  691. this.code=e.code
  692. this.getdictsysinfo()
  693. this.getUserName()
  694. },
  695. methods: {
  696. checkinletPressure(e) {
  697. console.log(e)
  698. //正则表达试
  699. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  700. //重新赋值给input
  701. this.$nextTick(() => {
  702. this.form.inletPressure= e
  703. })
  704. },
  705. checkexportPressureMain(e) {
  706. console.log(e)
  707. //正则表达试
  708. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  709. //重新赋值给input
  710. this.$nextTick(() => {
  711. this.form.exportPressureMain= e
  712. })
  713. },
  714. checkclosingPressureAccessory(e) {
  715. console.log(e)
  716. //正则表达试
  717. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  718. //重新赋值给input
  719. this.$nextTick(() => {
  720. this.form.closingPressureAccessory= e
  721. })
  722. },
  723. checkexportPressureAccessory(e) {
  724. console.log(e)
  725. //正则表达试
  726. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  727. //重新赋值给input
  728. this.$nextTick(() => {
  729. this.form.exportPressureAccessory= e
  730. })
  731. },
  732. checkclosingPressureMain(e) {
  733. console.log(e)
  734. //正则表达试
  735. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  736. //重新赋值给input
  737. this.$nextTick(() => {
  738. this.form.closingPressureMain= e
  739. })
  740. },
  741. checkcutOffPressureMain(e) {
  742. console.log(e)
  743. //正则表达试
  744. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  745. //重新赋值给input
  746. this.$nextTick(() => {
  747. this.form.cutOffPressureMain= e
  748. })
  749. },
  750. checkcutOffPressureAccessory(e) {
  751. console.log(e)
  752. //正则表达试
  753. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  754. //重新赋值给input
  755. this.$nextTick(() => {
  756. this.form.cutOffPressureAccessory= e
  757. })
  758. },
  759. checkreleasePressure(e) {
  760. console.log(e)
  761. //正则表达试
  762. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  763. //重新赋值给input
  764. this.$nextTick(() => {
  765. this.form.releasePressure= e
  766. })
  767. },
  768. getUserName(){
  769. service.getUserName().then(res=>{
  770. this.userId=res.id
  771. this.createBy=res.name
  772. this.getAdministrativeOffice(res.id)
  773. console.log(this.communityName)
  774. })
  775. },
  776. getAdministrativeOffice(userId){
  777. service.getAdministrativeOffice({userId:userId}).then(res=>{
  778. this.AdministrativeOfficeList=res
  779. })
  780. },
  781. getdictsysinfo() {
  782. let _this = this
  783. service.getDictInfoList({
  784. type: this.dictlist
  785. }).then(res => {
  786. _this.typelist = res
  787. if (this.type == 1) {
  788. service.getregulatorBox(this.id).then(res => {
  789. this.communityName = res.areaName
  790. this.time = res.createTime
  791. if (null != res.photoList) {
  792. res.photoList.forEach(item => {
  793. let url = {}
  794. url.url = item
  795. url.type = 'image'
  796. this.imgymxs.push(url)
  797. })
  798. }
  799. let list = []
  800. list = _this.typelist.xtv
  801. list.forEach((item) => {
  802. if (item.dictValue == res.xtv) {
  803. _this.xtvLabel = item.dictLabel
  804. }
  805. })
  806. let list2 = []
  807. list2 = _this.typelist.valve_well_condition
  808. list2.forEach((item) => {
  809. if (item.dictValue == res.valveWellCondition) {
  810. _this.valveWellConditioLabel = item.dictLabel
  811. }
  812. })
  813. let list3 = []
  814. list3 = _this.typelist.administrative_office
  815. list3.forEach((item) => {
  816. if (item.dictValue == res.administrativeOffice) {
  817. _this.AdministrativeOfficeLabel = item.dictLabel
  818. }
  819. })
  820. this.form = res
  821. })
  822. console.log(res)
  823. }
  824. })
  825. },
  826. //外观
  827. appearance(e) {
  828. this.$refs.form.appearance = e
  829. console.log(e)
  830. },
  831. explosionProofSwitch(e)
  832. {
  833. this.$refs.form.explosionProofSwitch = e
  834. console.log(e)
  835. },
  836. thermostat(e)
  837. {
  838. this.$refs.form.thermostat = e
  839. console.log(e)
  840. },
  841. businessService(e)
  842. {
  843. this.$refs.form.businessService = e
  844. console.log(e)
  845. },
  846. //方砖
  847. squareBrick(e) {
  848. this.$refs.form.squareBrick = e
  849. console.log(e)
  850. },
  851. //护栏
  852. guardrail(e) {
  853. this.$refs.form.guardrail = e
  854. console.log(e)
  855. },
  856. //基础
  857. foundation(e) {
  858. this.$refs.form.foundation = e
  859. console.log(e)
  860. },
  861. //压力表
  862. pressureGage(e) {
  863. this.$refs.form.pressureGage = e
  864. console.log(e)
  865. },
  866. //阀门
  867. valve(e) {
  868. this.$refs.form.valve = e
  869. console.log(e)
  870. },
  871. //调压器
  872. voltageRegulator(e) {
  873. this.$refs.form.voltageRegulator = e
  874. console.log(e)
  875. },
  876. isThereALeak(e)
  877. {
  878. this.$refs.form.isThereALeak = e
  879. console.log(e)
  880. },
  881. //切断器(放散阀)测试情况
  882. disconnectorTestStatus(e) {
  883. this.$refs.form.disconnectorTestStatus = e
  884. console.log(e)
  885. },
  886. cutterTested(e)
  887. {
  888. this.$refs.form.cutterTested = e
  889. console.log(e)
  890. },
  891. //过滤器
  892. filter(e) {
  893. this.$refs.form.filter = e
  894. console.log(e)
  895. },
  896. manOfAccessoryAlternating(e)
  897. {
  898. this.$refs.form.manOfAccessoryAlternating = e
  899. console.log(e)
  900. },
  901. specialCaseOfPressureRegulatingFacilities(e) {
  902. this.$refs.form.specialCaseOfPressureRegulatingFacilities = e
  903. console.log(e)
  904. },
  905. overdueInspectionDays(e) {
  906. this.$refs.form.overdueInspectionDays = e
  907. console.log(e)
  908. },
  909. reasonForOverdueInspection(e) {
  910. this.$refs.form.reasonForOverdueInspection = e
  911. console.log(e)
  912. },
  913. xtv(e) {
  914. this.$refs.form.xtv = e
  915. // this.form.xtv = e[0].value
  916. // this.xtvLabel = e[0].label
  917. // console.log(this.xtvLabel)
  918. },
  919. AdministrativeOffice(e)
  920. {
  921. this.form.administrativeOffice=e[0].value
  922. this.AdministrativeOfficeLabel = e[0].label
  923. console.log('11111',e)
  924. },
  925. valveWellCondition(e) {
  926. this.form.valveWellCondition = e[0].value
  927. this.valveWellConditioLabel = e[0].label
  928. console.log(this.$refs.form.valveWellCondition)
  929. },
  930. save() {
  931. let _this = this
  932. if(this.imgArr.length==0)
  933. {
  934. this.$UTILS.showPrompt('请上传照片或视频!')
  935. return
  936. }
  937. this.form.photoList = this.imgArr
  938. this.form.unitId = this.unit
  939. this.form.areaId = this.communityId
  940. this.form.userId=this.userId
  941. this.form.createBy=this.userId
  942. // this.form.administrativeOffice=this.administrativeOffice
  943. // this.form.code=this.code
  944. // this.form.name=this.name
  945. // this.form.number=this.code
  946. service.setregulatorBox(this.form).then(res => {
  947. console.log(res)
  948. _this.$UTILS.showPrompt('上报成功!')
  949. // setTimeout(() => {
  950. // console.log('跳')
  951. // uni.switchTab({
  952. // url: '/pages/index/index'
  953. // })
  954. // }, 2000)
  955. this.form={businessService:0,
  956. administrativeOffice:0,
  957. businessService:0,
  958. isNotXtv:0,
  959. appearance:0,
  960. squareBrick:0,
  961. foundation:0,
  962. pressureGage:0,
  963. valve:0,
  964. isThereALeak:0,
  965. voltageRegulator:0,
  966. xtv:0,
  967. thermostat:0,
  968. explosionProofSwitch:0,
  969. cutterTested:0,
  970. manOfAccessoryAlternating:0,
  971. filter:0,
  972. specialCaseOfPressureRegulatingFacilities:0,
  973. overdueInspectionDays:3,
  974. valveWellTesting:true,
  975. guardrail:0}
  976. this.valveWellConditioLabel=''
  977. this.xtvLabel=''
  978. this.valveWellConditioLabel=''
  979. this.AdministrativeOfficeLabel=''
  980. this.form.administrativeOffice=this.administrativeOffice
  981. this.form.number=this.code
  982. this.imgArr=[]
  983. this.imgymxs=[]
  984. })
  985. },
  986. choose() {
  987. let _this = this;
  988. uni.showActionSheet({
  989. title: '上传',
  990. itemList: ['图片', '视频'],
  991. success: (res) => {
  992. // console.log(res)
  993. if (res.tapIndex == 0) {
  994. this.chooseimage()
  995. } else {
  996. this.choosevideo()
  997. }
  998. }
  999. })
  1000. },
  1001. chooseimage() {
  1002. console.log('图片')
  1003. let _this = this;
  1004. uni.chooseImage({
  1005. sourceType: ['camera'],
  1006. success(resp) {
  1007. console.log('res--uni.chooseMedia', resp);
  1008. resp.tempFiles.forEach((item, index) => {
  1009. const task = uni.uploadFile({
  1010. url: _this.$HTTP.webUrl + `/obs`,
  1011. filePath: item.path,
  1012. name: 'file',
  1013. formData: {},
  1014. header: _this.headers,
  1015. success: res => {
  1016. // 判断是否json字符串,将其转为json格式
  1017. let data = _this.$u.test.jsonString(res.data) ? JSON.parse(
  1018. res.data) : res.data;
  1019. if (![200, 201, 204].includes(res.statusCode)) {
  1020. // this.uploadError(index, data);
  1021. _this.$UTILS.showPrompt('选取失败!')
  1022. } else {
  1023. // 上传成功
  1024. // this.lists[index].response = data;
  1025. // this.lists[index].progress = 100;
  1026. // this.lists[index].error = false;
  1027. // this.$emit('on-success', data, index, this.lists, this
  1028. // .index);
  1029. if (_this.progress === 100) {
  1030. // console.log('_this.progress', _this.progress)
  1031. // console.log('data----', data)
  1032. // console.log('res--', res)
  1033. _this.imgymxs.push({
  1034. url: data.data.url,
  1035. type: 'image'
  1036. })
  1037. _this.imgArr.push(data.data.url)
  1038. // console.log('imgArr', _this.imgArr)
  1039. _this.$UTILS.showPrompt('选取成功!')
  1040. }
  1041. }
  1042. },
  1043. fail: e => {
  1044. _this.$UTILS.showPrompt('选取失败!')
  1045. this.uploadError(index, e);
  1046. },
  1047. complete: res => {
  1048. _this.uploading = false;
  1049. // _this.uploadFile(index + 1);
  1050. // this.$emit('on-change', res, index, this.lists, this
  1051. // .index);
  1052. }
  1053. });
  1054. task.onProgressUpdate(res => {
  1055. // if (res.progress > 0) {
  1056. // this.lists[index].progress = res.progress;
  1057. // this.$emit('on-progress', res, index, this.lists, this.index);
  1058. // }
  1059. _this.progress = res.progress;
  1060. console.log('onProgressUpdate', res)
  1061. uni.showLoading({
  1062. title: '选取中'
  1063. })
  1064. });
  1065. })
  1066. },
  1067. })
  1068. },
  1069. choosevideo() {
  1070. let _this = this;
  1071. console.log('视频')
  1072. uni.chooseVideo({
  1073. sourceType: ['camera'],
  1074. maxDuration: 30,
  1075. success(resp) {
  1076. const task = uni.uploadFile({
  1077. url: _this.$HTTP.webUrl + `/obs`,
  1078. filePath: resp.tempFilePath,
  1079. name: 'file',
  1080. formData: {},
  1081. header: _this.headers,
  1082. success: res => {
  1083. // 判断是否json字符串,将其转为json格式
  1084. let data = _this.$u.test.jsonString(res.data) ? JSON.parse(res.data) :
  1085. res.data;
  1086. if (![200, 201, 204].includes(res.statusCode)) {
  1087. this.uploadError(index, data);
  1088. } else {
  1089. // 上传成功
  1090. // this.lists[index].response = data;
  1091. // this.lists[index].progress = 100;
  1092. // this.lists[index].error = false;
  1093. // this.$emit('on-success', data, index, this.lists, this
  1094. // .index);
  1095. if (_this.progress === 100) {
  1096. console.log('_this.progress', _this.progress)
  1097. console.log('data----', data)
  1098. console.log('res--', res)
  1099. // _this.imgArr.push(data.data.url)
  1100. _this.imgymxs.push({
  1101. url: data.data.url,
  1102. type: 'video'
  1103. })
  1104. _this.imgArr.push(data.data.url)
  1105. console.log('imgArr', _this.imgArr)
  1106. _this.$UTILS.showPrompt('选取成功!')
  1107. }
  1108. }
  1109. },
  1110. fail: e => {
  1111. _this.$UTILS.showPrompt('选取失败!')
  1112. this.uploadError(index, e);
  1113. },
  1114. complete: res => {
  1115. uni.hideLoading();
  1116. _this.uploading = false;
  1117. // _this.uploadFile(index + 1);
  1118. // this.$emit('on-change', res, index, this.lists, this
  1119. // .index);
  1120. }
  1121. });
  1122. task.onProgressUpdate(res => {
  1123. // if (res.progress > 0) {
  1124. // this.lists[index].progress = res.progress;
  1125. // this.$emit('on-progress', res, index, this.lists, this.index);
  1126. // }
  1127. _this.progress = res.progress;
  1128. console.log('onProgressUpdate', res)
  1129. uni.showLoading({
  1130. title: '选取中'
  1131. })
  1132. });
  1133. },
  1134. })
  1135. },
  1136. remove(index) {
  1137. uni.showModal({
  1138. title: '提示',
  1139. content: '是否删除该图片或视频?',
  1140. success: (res) => {
  1141. if (res.confirm) {
  1142. this.imgArr.splice(index, 1);
  1143. this.imgymxs.splice(index, 1);
  1144. console.log('this.imgArr', this.imgArr)
  1145. }
  1146. }
  1147. })
  1148. },
  1149. }
  1150. }
  1151. </script>
  1152. <style>
  1153. .project-content {
  1154. padding: 0rpx 20rpx;
  1155. border-radius: 20rpx;
  1156. width: 90%;
  1157. margin: 0 auto;
  1158. background: #fff;
  1159. }
  1160. .background {
  1161. z-index: -1;
  1162. position: fixed;
  1163. width: 100%;
  1164. height: 100%;
  1165. background-size: 100% 100%;
  1166. }
  1167. .top-left {
  1168. display: flex;
  1169. align-items: center;
  1170. }
  1171. .small-title {
  1172. font-size: 38rpx;
  1173. color: #2d95f4;
  1174. margin: 20rpx 0;
  1175. }
  1176. .form-item {
  1177. display: flex;
  1178. align-items: center;
  1179. font-size: 32rpx;
  1180. border: none;
  1181. }
  1182. .danwei {
  1183. text-align: center;
  1184. line-height: 110rpx;
  1185. }
  1186. .un-row {
  1187. text-align: left;
  1188. }
  1189. .top {
  1190. display: flex;
  1191. align-items: center;
  1192. justify-content: space-between;
  1193. }
  1194. .top-icon {
  1195. font-size: 40rpx;
  1196. color: #2d95f4;
  1197. }
  1198. </style>