PressureRegulatingBox.vue 47 KB

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