PressureRegulatingBox.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223
  1. <template>
  2. <view>
  3. <image src="https://121.37.40.217/app/images/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()" disabled> </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="https://121.37.40.217/app/images/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.getdictsysinfo()
  685. this.getUserName()
  686. this.form.areaId = e.id
  687. this.communityId=e.id
  688. this.communityName = e.name
  689. this.form.number=e.number
  690. this.administrativeOffice=e.managementOffice
  691. this.form.administrativeOffice=e.managementOffice
  692. this.form.name=e.name
  693. this.name=e.name
  694. this.code=e.number
  695. //this.getAdministrativeOffice(this.userId)
  696. },
  697. methods: {
  698. checkinletPressure(e) {
  699. console.log(e)
  700. //正则表达试
  701. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  702. //重新赋值给input
  703. this.$nextTick(() => {
  704. this.form.inletPressure= e
  705. })
  706. },
  707. checkexportPressureMain(e) {
  708. console.log(e)
  709. //正则表达试
  710. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  711. //重新赋值给input
  712. this.$nextTick(() => {
  713. this.form.exportPressureMain= e
  714. })
  715. },
  716. checkclosingPressureAccessory(e) {
  717. console.log(e)
  718. //正则表达试
  719. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  720. //重新赋值给input
  721. this.$nextTick(() => {
  722. this.form.closingPressureAccessory= e
  723. })
  724. },
  725. checkexportPressureAccessory(e) {
  726. console.log(e)
  727. //正则表达试
  728. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  729. //重新赋值给input
  730. this.$nextTick(() => {
  731. this.form.exportPressureAccessory= e
  732. })
  733. },
  734. checkclosingPressureMain(e) {
  735. console.log(e)
  736. //正则表达试
  737. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  738. //重新赋值给input
  739. this.$nextTick(() => {
  740. this.form.closingPressureMain= e
  741. })
  742. },
  743. checkcutOffPressureMain(e) {
  744. console.log(e)
  745. //正则表达试
  746. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  747. //重新赋值给input
  748. this.$nextTick(() => {
  749. this.form.cutOffPressureMain= e
  750. })
  751. },
  752. checkcutOffPressureAccessory(e) {
  753. console.log(e)
  754. //正则表达试
  755. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  756. //重新赋值给input
  757. this.$nextTick(() => {
  758. this.form.cutOffPressureAccessory= e
  759. })
  760. },
  761. checkreleasePressure(e) {
  762. console.log(e)
  763. //正则表达试
  764. e = (e.match(/^\d*(\.?\d{0,2})/g)[0]) || null
  765. //重新赋值给input
  766. this.$nextTick(() => {
  767. this.form.releasePressure= e
  768. })
  769. },
  770. getUserName(){
  771. service.getUserName().then(res=>{
  772. this.userId=res.id
  773. this.createBy=res.name
  774. this.getAdministrativeOffice(res.id)
  775. console.log(this.communityName)
  776. })
  777. },
  778. getAdministrativeOffice(userId){
  779. service.getAdministrativeOffice({userId:userId}).then(res=>{
  780. this.AdministrativeOfficeList=res
  781. if(this.type!=1)
  782. {
  783. this.AdministrativeOfficeLabel=this.AdministrativeOfficeList.filter(item=>item.value==this.administrativeOffice)[0].name
  784. }
  785. })
  786. },
  787. getdictsysinfo() {
  788. let _this = this
  789. service.getDictInfoList({
  790. type: this.dictlist
  791. }).then(res => {
  792. _this.typelist = res
  793. if (this.type == 1) {
  794. service.getregulatorBox(this.id).then(res => {
  795. this.communityName = res.name
  796. this.time = res.createTime
  797. if (null != res.photoList) {
  798. res.photoList.forEach(item => {
  799. let url = {}
  800. url.url = item
  801. url.type = 'image'
  802. this.imgymxs.push(url)
  803. })
  804. }
  805. let list = []
  806. list = _this.typelist.xtv
  807. list.forEach((item) => {
  808. if (item.dictValue == res.xtv) {
  809. _this.xtvLabel = item.dictLabel
  810. }
  811. })
  812. let list2 = []
  813. list2 = _this.typelist.valve_well_condition
  814. list2.forEach((item) => {
  815. if (item.dictValue == res.valveWellCondition) {
  816. _this.valveWellConditioLabel = item.dictLabel
  817. }
  818. })
  819. let list3 = []
  820. list3 = _this.typelist.administrative_office
  821. list3.forEach((item) => {
  822. if (item.dictValue == res.administrativeOffice) {
  823. _this.AdministrativeOfficeLabel = item.dictLabel
  824. }
  825. })
  826. this.form = res
  827. })
  828. console.log(res)
  829. }
  830. })
  831. },
  832. //外观
  833. appearance(e) {
  834. this.$refs.form.appearance = e
  835. console.log(e)
  836. },
  837. explosionProofSwitch(e)
  838. {
  839. this.$refs.form.explosionProofSwitch = e
  840. console.log(e)
  841. },
  842. thermostat(e)
  843. {
  844. this.$refs.form.thermostat = e
  845. console.log(e)
  846. },
  847. businessService(e)
  848. {
  849. this.$refs.form.businessService = e
  850. console.log(e)
  851. },
  852. //方砖
  853. squareBrick(e) {
  854. this.$refs.form.squareBrick = e
  855. console.log(e)
  856. },
  857. //护栏
  858. guardrail(e) {
  859. this.$refs.form.guardrail = e
  860. console.log(e)
  861. },
  862. //基础
  863. foundation(e) {
  864. this.$refs.form.foundation = e
  865. console.log(e)
  866. },
  867. //压力表
  868. pressureGage(e) {
  869. this.$refs.form.pressureGage = e
  870. console.log(e)
  871. },
  872. //阀门
  873. valve(e) {
  874. this.$refs.form.valve = e
  875. console.log(e)
  876. },
  877. //调压器
  878. voltageRegulator(e) {
  879. this.$refs.form.voltageRegulator = e
  880. console.log(e)
  881. },
  882. isThereALeak(e)
  883. {
  884. this.$refs.form.isThereALeak = e
  885. console.log(e)
  886. },
  887. //切断器(放散阀)测试情况
  888. disconnectorTestStatus(e) {
  889. this.$refs.form.disconnectorTestStatus = e
  890. console.log(e)
  891. },
  892. cutterTested(e)
  893. {
  894. this.$refs.form.cutterTested = e
  895. console.log(e)
  896. },
  897. //过滤器
  898. filter(e) {
  899. this.$refs.form.filter = e
  900. console.log(e)
  901. },
  902. manOfAccessoryAlternating(e)
  903. {
  904. this.$refs.form.manOfAccessoryAlternating = e
  905. console.log(e)
  906. },
  907. specialCaseOfPressureRegulatingFacilities(e) {
  908. this.$refs.form.specialCaseOfPressureRegulatingFacilities = e
  909. console.log(e)
  910. },
  911. overdueInspectionDays(e) {
  912. this.$refs.form.overdueInspectionDays = e
  913. console.log(e)
  914. },
  915. reasonForOverdueInspection(e) {
  916. this.$refs.form.reasonForOverdueInspection = e
  917. console.log(e)
  918. },
  919. xtv(e) {
  920. this.$refs.form.xtv = e
  921. // this.form.xtv = e[0].value
  922. // this.xtvLabel = e[0].label
  923. // console.log(this.xtvLabel)
  924. },
  925. AdministrativeOffice(e)
  926. {
  927. this.form.administrativeOffice=e[0].value
  928. this.AdministrativeOfficeLabel = e[0].label
  929. console.log('11111',e)
  930. },
  931. valveWellCondition(e) {
  932. this.form.valveWellCondition = e[0].value
  933. this.valveWellConditioLabel = e[0].label
  934. console.log(this.$refs.form.valveWellCondition)
  935. },
  936. save() {
  937. let _this = this
  938. if(this.imgArr.length==0)
  939. {
  940. this.$UTILS.showPrompt('请上传照片或视频!')
  941. return
  942. }
  943. this.form.photoList = this.imgArr
  944. this.form.unitId = this.unit
  945. this.form.areaId = this.id
  946. this.form.userId=this.userId
  947. this.form.createBy=this.userId
  948. this.form.name=this.name
  949. // this.form.administrativeOffice=this.administrativeOffice
  950. // this.form.code=this.code
  951. // this.form.name=this.name
  952. // this.form.number=this.code
  953. service.setregulatorBox(this.form).then(res => {
  954. console.log(res)
  955. _this.$UTILS.showPrompt('上报成功!')
  956. // setTimeout(() => {
  957. // console.log('跳')
  958. // uni.switchTab({
  959. // url: '/pages/index/index'
  960. // })
  961. // }, 2000)
  962. this.form={businessService:0,
  963. administrativeOffice:0,
  964. businessService:0,
  965. isNotXtv:0,
  966. appearance:0,
  967. squareBrick:0,
  968. foundation:0,
  969. pressureGage:0,
  970. valve:0,
  971. isThereALeak:0,
  972. voltageRegulator:0,
  973. xtv:0,
  974. thermostat:0,
  975. explosionProofSwitch:0,
  976. cutterTested:0,
  977. manOfAccessoryAlternating:0,
  978. filter:0,
  979. specialCaseOfPressureRegulatingFacilities:0,
  980. overdueInspectionDays:3,
  981. valveWellTesting:true,
  982. guardrail:0}
  983. this.AdministrativeOfficeLabel=this.AdministrativeOfficeList.filter(item=>item.value==this.administrativeOffice)[0].name
  984. this.valveWellConditioLabel=''
  985. this.xtvLabel=''
  986. this.valveWellConditioLabel=''
  987. //this.AdministrativeOfficeLabel=''
  988. this.form.administrativeOffice=this.administrativeOffice
  989. this.form.number=this.code
  990. this.imgArr=[]
  991. this.imgymxs=[]
  992. })
  993. },
  994. choose() {
  995. let _this = this;
  996. uni.showActionSheet({
  997. title: '上传',
  998. itemList: ['图片', '视频'],
  999. success: (res) => {
  1000. // console.log(res)
  1001. if (res.tapIndex == 0) {
  1002. this.chooseimage()
  1003. } else {
  1004. this.choosevideo()
  1005. }
  1006. }
  1007. })
  1008. },
  1009. chooseimage() {
  1010. console.log('图片')
  1011. let _this = this;
  1012. uni.chooseImage({
  1013. sourceType: ['camera'],
  1014. success(resp) {
  1015. console.log('res--uni.chooseMedia', resp);
  1016. resp.tempFiles.forEach((item, index) => {
  1017. const task = uni.uploadFile({
  1018. url: _this.$HTTP.webUrl + `/obs`,
  1019. filePath: item.path,
  1020. name: 'file',
  1021. formData: {},
  1022. header: _this.headers,
  1023. success: res => {
  1024. // 判断是否json字符串,将其转为json格式
  1025. let data = _this.$u.test.jsonString(res.data) ? JSON.parse(
  1026. res.data) : res.data;
  1027. if (![200, 201, 204].includes(res.statusCode)) {
  1028. // this.uploadError(index, data);
  1029. _this.$UTILS.showPrompt('选取失败!')
  1030. } else {
  1031. // 上传成功
  1032. // this.lists[index].response = data;
  1033. // this.lists[index].progress = 100;
  1034. // this.lists[index].error = false;
  1035. // this.$emit('on-success', data, index, this.lists, this
  1036. // .index);
  1037. if (_this.progress === 100) {
  1038. // console.log('_this.progress', _this.progress)
  1039. // console.log('data----', data)
  1040. // console.log('res--', res)
  1041. _this.imgymxs.push({
  1042. url: data.data.url,
  1043. type: 'image'
  1044. })
  1045. _this.imgArr.push(data.data.url)
  1046. // console.log('imgArr', _this.imgArr)
  1047. _this.$UTILS.showPrompt('选取成功!')
  1048. }
  1049. }
  1050. },
  1051. fail: e => {
  1052. _this.$UTILS.showPrompt('选取失败!')
  1053. this.uploadError(index, e);
  1054. },
  1055. complete: res => {
  1056. _this.uploading = false;
  1057. // _this.uploadFile(index + 1);
  1058. // this.$emit('on-change', res, index, this.lists, this
  1059. // .index);
  1060. }
  1061. });
  1062. task.onProgressUpdate(res => {
  1063. // if (res.progress > 0) {
  1064. // this.lists[index].progress = res.progress;
  1065. // this.$emit('on-progress', res, index, this.lists, this.index);
  1066. // }
  1067. _this.progress = res.progress;
  1068. console.log('onProgressUpdate', res)
  1069. uni.showLoading({
  1070. title: '选取中'
  1071. })
  1072. });
  1073. })
  1074. },
  1075. })
  1076. },
  1077. choosevideo() {
  1078. let _this = this;
  1079. console.log('视频')
  1080. uni.chooseVideo({
  1081. sourceType: ['camera'],
  1082. maxDuration: 30,
  1083. success(resp) {
  1084. const task = uni.uploadFile({
  1085. url: _this.$HTTP.webUrl + `/obs`,
  1086. filePath: resp.tempFilePath,
  1087. name: 'file',
  1088. formData: {},
  1089. header: _this.headers,
  1090. success: res => {
  1091. // 判断是否json字符串,将其转为json格式
  1092. let data = _this.$u.test.jsonString(res.data) ? JSON.parse(res.data) :
  1093. res.data;
  1094. if (![200, 201, 204].includes(res.statusCode)) {
  1095. this.uploadError(index, data);
  1096. } else {
  1097. // 上传成功
  1098. // this.lists[index].response = data;
  1099. // this.lists[index].progress = 100;
  1100. // this.lists[index].error = false;
  1101. // this.$emit('on-success', data, index, this.lists, this
  1102. // .index);
  1103. if (_this.progress === 100) {
  1104. console.log('_this.progress', _this.progress)
  1105. console.log('data----', data)
  1106. console.log('res--', res)
  1107. // _this.imgArr.push(data.data.url)
  1108. _this.imgymxs.push({
  1109. url: data.data.url,
  1110. type: 'video'
  1111. })
  1112. _this.imgArr.push(data.data.url)
  1113. console.log('imgArr', _this.imgArr)
  1114. _this.$UTILS.showPrompt('选取成功!')
  1115. }
  1116. }
  1117. },
  1118. fail: e => {
  1119. _this.$UTILS.showPrompt('选取失败!')
  1120. this.uploadError(index, e);
  1121. },
  1122. complete: res => {
  1123. uni.hideLoading();
  1124. _this.uploading = false;
  1125. // _this.uploadFile(index + 1);
  1126. // this.$emit('on-change', res, index, this.lists, this
  1127. // .index);
  1128. }
  1129. });
  1130. task.onProgressUpdate(res => {
  1131. // if (res.progress > 0) {
  1132. // this.lists[index].progress = res.progress;
  1133. // this.$emit('on-progress', res, index, this.lists, this.index);
  1134. // }
  1135. _this.progress = res.progress;
  1136. console.log('onProgressUpdate', res)
  1137. uni.showLoading({
  1138. title: '选取中'
  1139. })
  1140. });
  1141. },
  1142. })
  1143. },
  1144. remove(index) {
  1145. uni.showModal({
  1146. title: '提示',
  1147. content: '是否删除该图片或视频?',
  1148. success: (res) => {
  1149. if (res.confirm) {
  1150. this.imgArr.splice(index, 1);
  1151. this.imgymxs.splice(index, 1);
  1152. console.log('this.imgArr', this.imgArr)
  1153. }
  1154. }
  1155. })
  1156. },
  1157. }
  1158. }
  1159. </script>
  1160. <style>
  1161. .project-content {
  1162. padding: 0rpx 20rpx;
  1163. border-radius: 20rpx;
  1164. width: 90%;
  1165. margin: 0 auto;
  1166. background: #fff;
  1167. }
  1168. .background {
  1169. z-index: -1;
  1170. position: fixed;
  1171. width: 100%;
  1172. height: 100%;
  1173. background-size: 100% 100%;
  1174. }
  1175. .top-left {
  1176. display: flex;
  1177. align-items: center;
  1178. }
  1179. .small-title {
  1180. font-size: 38rpx;
  1181. color: #2d95f4;
  1182. margin: 20rpx 0;
  1183. }
  1184. .form-item {
  1185. display: flex;
  1186. align-items: center;
  1187. font-size: 32rpx;
  1188. border: none;
  1189. }
  1190. .danwei {
  1191. text-align: center;
  1192. line-height: 110rpx;
  1193. }
  1194. .un-row {
  1195. text-align: left;
  1196. }
  1197. .top {
  1198. display: flex;
  1199. align-items: center;
  1200. justify-content: space-between;
  1201. }
  1202. .top-icon {
  1203. font-size: 40rpx;
  1204. color: #2d95f4;
  1205. }
  1206. </style>