PressureRegulatingBox.vue 39 KB

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