PressureRegulatingBox.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958
  1. <template>
  2. <view>
  3. <image src="/static/icon/background.png" class="background"></image>
  4. <view class="project-content">
  5. <u-form :model="form" ref="form">
  6. <view class="top">
  7. <u-icon class="top-icon" name="map-fill"></u-icon>
  8. <u-form-item label=" " borderBottom ref="item1" placeholder=" " labelWidth="80" 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="80">
  13. <u-input v-model="time" disabled length='20px' trim="false" placeholder=" " ></u-input>
  14. </u-form-item>
  15. </view>
  16. <view class="small-title">调压箱部分</view>
  17. <u-row gutter="12">
  18. <u-col>
  19. <u-form-item label="管理所" borderBottom ref="item1" labelWidth="140">
  20. <u-input v-model="form.administrativeOffice" placeholder="请输入管理所名称" :disabled="type==1"></u-input>
  21. </u-form-item>
  22. </u-col>
  23. <u-col>
  24. <u-form-item label="编号" borderBottom ref="item1" labelWidth="140">
  25. <u-input v-model="form.number" placeholder="请输入编号" :disabled="type==1"></u-input>
  26. </u-form-item>
  27. </u-col>
  28. <u-col>
  29. <u-form-item label="商服" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  30. <u-switch v-model="form.businessService" :disabled="type==1"></u-switch>
  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.appearance" :disabled="type==1">
  36. <u-radio @change="appearance" v-for="(item, index) in typelist.appearance" :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.squareBrick" :disabled="type==1">
  46. <u-radio @change="squareBrick" v-for="(item, index) in typelist.square_brick" :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.guardrail" :disabled="type==1">
  56. <u-radio @change="guardrail" v-for="(item, index) in typelist.guardrail" :key="index"
  57. :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.foundation" :disabled="type==1">
  66. <u-radio @change="foundation" v-for="(item, index) in typelist.foundation" :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.pressureGage" :disabled="type==1">
  76. <u-radio @change="pressureGage" v-for="(item, index) in typelist.pressure_gage" :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.valve" :disabled="type==1">
  86. <u-radio @change="valve" v-for="(item, index) in typelist.valve" :key="index"
  87. :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-switch v-model="form.isThereALeak" :disabled="type==1"></u-switch>
  96. </u-form-item>
  97. </u-col>
  98. <u-col>
  99. <u-form-item label="调压器" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  100. <u-radio-group v-model="form.voltageRegulator" :disabled="type==1">
  101. <u-radio @change="voltageRegulator" v-for="(item, index) in typelist.voltage_regulator"
  102. :key="index" :name="item.dictValue">
  103. {{item.dictLabel}}
  104. </u-radio>
  105. </u-radio-group>
  106. </u-form-item>
  107. </u-col>
  108. </u-row>
  109. <u-row class="un-row" gutter="12" style="text-align:left;">
  110. <u-col span="10">
  111. <u-form-item label="入口压力" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  112. <u-input v-model="form.inletPressure" length='20px' placeholder="请输入管理所名称" :disabled="type==1"></u-input>
  113. </u-form-item>
  114. </u-col>
  115. <u-col span="2">
  116. <viwe class="danwei">Mpa</viwe>
  117. </u-col>
  118. </u-row>
  119. <u-row gutter="12">
  120. <u-col span="5">
  121. <u-form-item label="出口压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200">
  122. <u-input v-model="form.exportPressureMain" placeholder=" " :disabled="type==1"></u-input>
  123. </u-form-item>
  124. </u-col>
  125. <u-col span="2">
  126. <viwe class="danwei">KPa</viwe>
  127. </u-col>
  128. <u-col span="3">
  129. <u-form-item label="副路" borderBottom ref="item1" placeholder=" " labelWidth="80">
  130. <u-input v-model="form.exportPressureAccessory" length='20px' trim="false"
  131. aceholder="" :disabled="type==1"></u-input>
  132. </u-form-item>
  133. </u-col>
  134. <u-col span="1">
  135. <viwe class="danwei">KPa</viwe>
  136. </u-col>
  137. </u-row>
  138. <u-row gutter="12">
  139. <u-col span="5">
  140. <u-form-item label="关闭压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200">
  141. <u-input v-model="form.closingPressureMain" placeholder=" " trim="false" :disabled="type==1"></u-input>
  142. </u-form-item>
  143. </u-col>
  144. <u-col span="2">
  145. <viwe class="danwei">KPa</viwe>
  146. </u-col>
  147. <u-col span="3">
  148. <u-form-item label="副路" borderBottom ref="item1" placeholder=" " labelWidth="80">
  149. <u-input v-model="form.closingPressureAccessory" length='20px' trim="false"
  150. placeholder=" " :disabled="type==1"></u-input>
  151. </u-form-item>
  152. </u-col>
  153. <u-col span="1">
  154. <viwe class="danwei">KPa</viwe>
  155. </u-col>
  156. </u-row>
  157. <u-row>
  158. <u-col>
  159. <u-form-item label="伴热带" labelWidth="140" borderBottom ref="item1">
  160. <u-input v-model="xtvLabel" disabled @click="showxtv= true&&type!=1" borderBottom></u-input>
  161. <u-select v-model="showxtv" :list="typelist.xtv" @confirm="xtv()" :show="showxtv"
  162. label-name="dictLabel" value-name="dictValue"> </u-select>
  163. <u-icon slot="right" name="arrow-right"></u-icon>
  164. </u-form-item>
  165. </u-col>
  166. <u-col>
  167. <u-form-item label="有无温控器" borderBottom ref="item1" placeholder="" labelWidth="180">
  168. <u-switch v-model="form.thermostat" :disabled="type==1"></u-switch>
  169. </u-form-item>
  170. </u-col>
  171. <u-col>
  172. <u-form-item label="有无防爆开关" borderBottom ref="item1" placeholder="" labelWidth="180">
  173. <u-switch v-model="form.explosionProofSwitch" :disabled="type==1"></u-switch>
  174. </u-form-item>
  175. </u-col>
  176. </u-row>
  177. <view class="small-title">切断器测证部分</view>
  178. <u-row>
  179. <u-col>
  180. <u-form-item label="未测试" borderBottom ref="item1" placeholder="" labelWidth="120">
  181. <u-switch v-model="form.cutterTested" :disabled="type==1"></u-switch>
  182. </u-form-item>
  183. </u-col>
  184. <u-col>
  185. <u-form-item label="切断器(放散阀)测试情况" borderBottom ref="item1" placeholder="" labelWidth="320">
  186. <u-radio-group v-model="form.disconnectorTestStatus" :disabled="type==1">
  187. <u-radio @change="disconnectorTestStatus"
  188. v-for="(item, index) in typelist.disconnector_test_status" :key="index"
  189. :name="item.dictValue">
  190. {{item.dictLabel}}
  191. </u-radio>
  192. </u-radio-group>
  193. </u-form-item>
  194. </u-col>
  195. </u-row>
  196. <u-row gutter="12">
  197. <u-col span="5">
  198. <u-form-item label="切断压力 主路" borderBottom ref="item1" placeholder=" " labelWidth="200">
  199. <u-input v-model="form.cutOffPressureMain" placeholder=" " :disabled="type==1"></u-input>
  200. </u-form-item>
  201. </u-col>
  202. <u-col span="2">
  203. <viwe class="danwei">KPa</viwe>
  204. </u-col>
  205. <u-col span="3">
  206. <u-form-item label="副路" borderBottom ref="item1" placeholder="" labelWidth="80">
  207. <u-input v-model="form.cutOffPressureAccessory" length='20px'
  208. placeholder="请输入管理所名称" :disabled="type==1"></u-input>
  209. </u-form-item>
  210. </u-col>
  211. <u-col span="1">
  212. <viwe class="danwei">KPa</viwe>
  213. </u-col>
  214. </u-row>
  215. <u-row gutter="12" style="text-align: center;">
  216. <u-col span="10">
  217. <u-form-item label="放散压力" borderBottom ref="item1" placeholder="请输入编号" labelWidth="140">
  218. <u-input v-model="form.releasePressure" length='20px' placeholder="请输入管理所名称" :disabled="type==1"></u-input>
  219. </u-form-item>
  220. </u-col>
  221. <u-col span="2">
  222. <viwe class="danwei">Mpa</viwe>
  223. </u-col>
  224. </u-row>
  225. <view class="small-title">主副路交替部分</view>
  226. <u-row>
  227. <u-col>
  228. <u-form-item label="未交替" borderBottom ref="item1" placeholder="请输入编号" labelWidth="120">
  229. <u-switch v-model="form.manOfAccessoryAlternating" :disabled="type==1"></u-switch>
  230. </u-form-item>
  231. </u-col>
  232. <u-col>
  233. <u-form-item label="过滤器" borderBottom ref="item1" placeholder="请输入编号" labelWidth="120">
  234. <u-radio-group v-model="form.filter" :disabled="type==1">
  235. <u-radio @change="filter" v-for="(item, index) in typelist.filter" :key="index"
  236. :name="item.dictValue">
  237. {{item.dictLabel}}
  238. </u-radio>
  239. </u-radio-group>
  240. </u-form-item>
  241. </u-col>
  242. </u-row>
  243. <u-row gutter="12" style="text-align: center;">
  244. <u-col span="12">
  245. <u-form-item label="操作结果主副路已交替完毕,现" borderBottom ref="item1" placeholder="请输入编号"
  246. labelWidth="420">
  247. <u-input v-model="form.mainRoad" length='20px' placeholder="请输入管理所名称" :disabled="type==1"></u-input>
  248. </u-form-item>
  249. </u-col>
  250. <u-col span="12">
  251. <viwe class="danwei">路为主路</viwe>
  252. </u-col>
  253. </u-row>
  254. <view class="small-title">特殊情况说明</view>
  255. <u-row>
  256. <u-col>
  257. <u-form-item label="调压设施特例" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
  258. <u-radio-group v-model="form.specialCaseOfPressureRegulatingFacilities" :disabled="type==1">
  259. <u-radio @change="specialCaseOfPressureRegulatingFacilities"
  260. v-for="(item, index) in typelist.special_case_of_pressure_regulating_facilities"
  261. :key="index" :name="item.dictValue">
  262. {{item.dictLabel}}
  263. </u-radio>
  264. </u-radio-group>
  265. </u-form-item>
  266. </u-col>
  267. <u-col>
  268. <u-form-item label="超期巡检天数" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
  269. <u-radio-group v-model="form.overdueInspectionDays" :disabled="type==1">
  270. <u-radio @change="overdueInspectionDays"
  271. v-for="(item, index) in typelist.overdue_inspection_days" :key="index"
  272. :name="item.dictValue">
  273. {{item.dictLabel}}
  274. </u-radio>
  275. </u-radio-group>
  276. </u-form-item>
  277. </u-col>
  278. <u-col>
  279. <u-form-item label="超期巡检原因" borderBottom ref="item1" placeholder="请输入编号" labelWidth="200">
  280. <u-radio-group v-model="form.reasonForOverdueInspection" :disabled="type==1">
  281. <u-radio @change="reasonForOverdueInspection"
  282. v-for="(item, index) in typelist.reason_for_overdue_inspection" :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-col>
  290. <u-form-item label="其他原因" borderBottom ref="item1" labelWidth="160">
  291. <u-input v-model="form.otherReasonsForOverdueInspection" placeholder="(非必填项)" :disabled="type==1"></u-input>
  292. </u-form-item>
  293. </u-col>
  294. </u-row>
  295. <view class="small-title">阀井测试部分</view>
  296. <u-row>
  297. <u-col>
  298. <u-form-item label="未测试" borderBottom ref="item1" placeholder="请输入编号" labelWidth="120">
  299. <u-switch v-model="form.valveWellTesting" :disabled="type==1"></u-switch>
  300. </u-form-item>
  301. </u-col>
  302. <u-col>
  303. <u-form-item label="阀井情况" labelWidth="140" borderBottom ref="item1">
  304. <u-input v-model="valveWellConditioLabel" disabled @click=" showvalveWellCondition= true&& type!=1"
  305. borderBottom></u-input>
  306. <u-select v-model="showvalveWellCondition" :list="typelist.valve_well_condition"
  307. @confirm="valveWellCondition()" label-name="dictLabel" value-name="dictValue"> </u-select>
  308. <u-icon slot="right" name="arrow-right"></u-icon>
  309. </u-form-item>
  310. </u-col>
  311. </u-row>
  312. <view class="small-title">备注信息</view>
  313. <u-row>
  314. <u-col>
  315. <u-form-item label=" " labelWidth="0" borderBottom ref="item1">
  316. <u-input v-model="form.remarks" type="textarea" borderBottom placeholder="请填写备注信息内容" :disabled="type==1"></u-input>
  317. </u-form-item>
  318. </u-col>
  319. <u-col>
  320. <u-form-item label=" " labelWidth="0" borderBottom ref="item1">
  321. <u-input v-model="form.WarningColumnInformation" disabled placeholder="请上传巡检照片"></u-input>
  322. <view class="" style="display: flex; flex-wrap: wrap; margin: 0 55rpx;">
  323. <image src="/static/icon/chooseimg.png" mode=""
  324. style="width: 190rpx; height: 190rpx; margin: 0 12rpx; " @click="choose()" v-if="type!=1"></image>
  325. <view v-for="(item,index) in imgymxs" :key="index" style="position: relative;">
  326. <view v-if="item.type == 'image'">
  327. <image :src="item.url" mode="" style="width: 190rpx; height: 190rpx; margin: 0 20rpx;"
  328. @click="showPhoto(index)">
  329. </image>
  330. </view>
  331. <view v-else>
  332. <video :src="item" style="width: 190rpx; height: 190rpx; margin: 0 20rpx;"></video>
  333. </view>
  334. <view @click="remove(index)"
  335. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%; background-color: #FF0000;">
  336. <u-icon name="close" color="#FFFFFF" size="35"></u-icon>
  337. </view>
  338. </view>
  339. </view>
  340. </u-form-item>
  341. </u-col>
  342. </u-row>
  343. </u-form>
  344. <u-button class="from-but" style="margin: 40rpx 0;" @click="save()" v-if="type!=1" type='primary'>确认上传</u-button>
  345. </view>
  346. </u-form>
  347. </view>
  348. </view>
  349. </template>
  350. <script>
  351. import service from '@/api/index.js'
  352. export default {
  353. data() {
  354. return {
  355. action: this.$HTTP.webUrl + `/obs`,
  356. headers: {
  357. MAuthorization: "wxBearer " + uni.getStorageSync('token')
  358. },
  359. url: [],
  360. uploading: false,
  361. imgArr: [],
  362. PhotoList:[],
  363. community:'',
  364. building:'',
  365. unit:'',
  366. imgymxs: [],
  367. progress: 0, //图片或视频上传百分比
  368. showxtv: false,
  369. showvalveWellCondition: false,
  370. form: {},
  371. xtvLabel: null,
  372. valveWellConditioLabel: null,
  373. // 表单校验
  374. rules: {
  375. areaId: [{
  376. required: true,
  377. message: "所属小区不能为空",
  378. trigger: "blur"
  379. }],
  380. buildingId: [{
  381. required: true,
  382. message: "所属楼宇不能为空",
  383. trigger: "blur"
  384. }],
  385. unitId: [{
  386. required: true,
  387. message: "单元id不能为空",
  388. trigger: "change"
  389. }],
  390. administrativeOffice: [{
  391. required: true,
  392. message: "管理所不能为空",
  393. trigger: "blur"
  394. }],
  395. number: [{
  396. required: true,
  397. message: "编号不能为空",
  398. trigger: "blur"
  399. }],
  400. businessService: [{
  401. required: true,
  402. message: "商服不能为空",
  403. trigger: "blur"
  404. }],
  405. appearance: [{
  406. required: true,
  407. message: "外观不能为空",
  408. trigger: "change"
  409. }],
  410. squareBrick: [{
  411. required: true,
  412. message: "方砖不能为空",
  413. trigger: "change"
  414. }],
  415. guardrail: [{
  416. required: true,
  417. message: "护栏不能为空",
  418. trigger: "change"
  419. }],
  420. foundation: [{
  421. required: true,
  422. message: "基础不能为空",
  423. trigger: "change"
  424. }],
  425. pressureGage: [{
  426. required: true,
  427. message: "压力表不能为空",
  428. trigger: "change"
  429. }],
  430. mainRoad: [{
  431. required: true,
  432. message: "当前主路不能为空",
  433. trigger: "change"
  434. }],
  435. valve: [{
  436. required: true,
  437. message: "阀门不能为空",
  438. trigger: "change"
  439. }],
  440. isThereALeak: [{
  441. required: true,
  442. message: "是否泄露不能为空",
  443. trigger: "blur"
  444. }],
  445. voltageRegulator: [{
  446. required: true,
  447. message: "调压器不能为空",
  448. trigger: "change"
  449. }],
  450. inletPressure: [{
  451. required: true,
  452. message: "入口压力不能为空",
  453. trigger: "blur"
  454. }],
  455. exportPressureMain: [{
  456. required: true,
  457. message: "出口压力(主路)不能为空",
  458. trigger: "blur"
  459. }],
  460. exportPressureAccessory: [{
  461. required: true,
  462. message: "出口压力(副路)不能为空",
  463. trigger: "blur"
  464. }],
  465. closingPressureMain: [{
  466. required: true,
  467. message: "关闭压力(主路)不能为空",
  468. trigger: "blur"
  469. }],
  470. closingPressureAccessory: [{
  471. required: true,
  472. message: "关闭压力(副路)不能为空",
  473. trigger: "blur"
  474. }],
  475. xtv: [{
  476. required: true,
  477. message: "伴热带不能为空",
  478. trigger: "change"
  479. }],
  480. thermostat: [{
  481. required: true,
  482. message: "有无控温器不能为空",
  483. trigger: "blur"
  484. }],
  485. explosionProofSwitch: [{
  486. required: true,
  487. message: "有无防爆开关不能为空",
  488. trigger: "blur"
  489. }],
  490. cutterTested: [{
  491. required: true,
  492. message: "切断器测试不能为空",
  493. trigger: "blur"
  494. }],
  495. disconnectorTestStatus: [{
  496. required: true,
  497. message: "切断器(放散阀)测试情况不能为空",
  498. trigger: "change"
  499. }],
  500. cutOffPressureMain: [{
  501. required: true,
  502. message: "切断压力(主路)不能为空",
  503. trigger: "blur"
  504. }],
  505. cutOffPressureAccessory: [{
  506. required: true,
  507. message: "切断压力(副路)不能为空",
  508. trigger: "blur"
  509. }],
  510. releasePressure: [{
  511. required: true,
  512. message: "放散压力不能为空",
  513. trigger: "blur"
  514. }],
  515. manOfAccessoryAlternating: [{
  516. required: true,
  517. message: "主副路交替不能为空",
  518. trigger: "blur"
  519. }],
  520. filter: [{
  521. required: true,
  522. message: "过滤器不能为空",
  523. trigger: "change"
  524. }],
  525. specialCaseOfPressureRegulatingFacilities: [{
  526. required: true,
  527. message: "调压设施特例不能为空",
  528. trigger: "change"
  529. }],
  530. overdueInspectionDays: [{
  531. required: true,
  532. message: "超期巡检天数不能为空",
  533. trigger: "change"
  534. }],
  535. reasonForOverdueInspection: [{
  536. required: true,
  537. message: "超期巡检原因不能为空",
  538. trigger: "change"
  539. }],
  540. otherReasonsForOverdueInspection: [{
  541. required: true,
  542. message: "超期巡检其他原因不能为空",
  543. trigger: "blur"
  544. }],
  545. valveWellTesting: [{
  546. required: true,
  547. message: "阀井测试不能为空",
  548. trigger: "blur"
  549. }],
  550. valveWellCondition: [{
  551. required: true,
  552. message: "阀井情况不能为空",
  553. trigger: "change"
  554. }]
  555. },
  556. communityName:'',
  557. time:'',
  558. showrepairType: false,
  559. showrepairType: null,
  560. checked: true,
  561. typelist: {},
  562. dictlist: ['appearance', 'square_brick', 'guardrail', 'foundation', 'pressure_gage', 'valve',
  563. 'voltage_regulator', 'xtv', 'disconnector_test_status', 'filter',
  564. 'special_case_of_pressure_regulating_facilities', 'overdue_inspection_days',
  565. 'reason_for_overdue_inspection', 'valve_well_condition', 'find_problem', 'xtv'
  566. ],
  567. type:2,
  568. id:null,
  569. }
  570. },
  571. onReady() {
  572. uni.setNavigationBarTitle({
  573. title: '调压箱表单'
  574. });
  575. },
  576. showPhoto(index){
  577. uni.previewImage({
  578. current:index,
  579. urls:this.imgArr,
  580. })
  581. },
  582. showPhotos(index){
  583. uni.previewImage({
  584. current:index,
  585. urls:this.photo,
  586. })
  587. },
  588. onLoad(e) {
  589. let time1 = new Date()
  590. this.type=e.type
  591. this.id=e.id
  592. this.time=time1.toLocaleString()
  593. this.form.areaId = e.community
  594. this.communityName = e.communityName
  595. // uni.setNavigationBarTitle({
  596. // title: '调压箱表单'
  597. // });
  598. this.getdictsysinfo()
  599. },
  600. methods: {
  601. getdictsysinfo() {
  602. let _this = this
  603. service.getDictInfoList({
  604. type: this.dictlist
  605. }).then(res => {
  606. _this.typelist = res
  607. if(this.type==1)
  608. {
  609. service.getregulatorBox(this.id
  610. ).then(res => {
  611. this.communityName=res.areaName
  612. this.time=res.createTime
  613. if(null!=res.photoList)
  614. {
  615. res.photoList.forEach(item=>{
  616. let url={}
  617. url.url=item
  618. url.type='image'
  619. this.imgymxs.push(url)
  620. })
  621. }
  622. let list =[]
  623. list=_this.typelist.xtv
  624. list.forEach((item)=>{
  625. if(item.dictValue==res.xtv)
  626. {
  627. _this.xtvLabel=item.dictLabel
  628. }
  629. })
  630. let list2 =[]
  631. list2=_this.typelist.valve_well_condition
  632. list2.forEach((item)=>{
  633. if(item.dictValue==res.valveWellCondition)
  634. {
  635. _this.valveWellConditioLabel=item.dictLabel
  636. }
  637. })
  638. this.form=res
  639. })
  640. console.log(res)
  641. }
  642. })
  643. },
  644. //外观
  645. appearance(e) {
  646. this.$refs.form.appearance = e
  647. console.log(e)
  648. },
  649. //方砖
  650. squareBrick(e) {
  651. this.$refs.form.squareBrick = e
  652. console.log(e)
  653. },
  654. //护栏
  655. guardrail(e) {
  656. this.$refs.form.guardrail = e
  657. console.log(e)
  658. },
  659. //基础
  660. foundation(e) {
  661. this.$refs.form.foundation = e
  662. console.log(e)
  663. },
  664. //压力表
  665. pressureGage(e) {
  666. this.$refs.form.pressureGage = e
  667. console.log(e)
  668. },
  669. //阀门
  670. valve(e) {
  671. this.$refs.form.valve = e
  672. console.log(e)
  673. },
  674. //调压器
  675. voltageRegulator(e) {
  676. this.$refs.form.voltageRegulator = e
  677. console.log(e)
  678. },
  679. //切断器(放散阀)测试情况
  680. disconnectorTestStatus(e) {
  681. this.$refs.form.disconnectorTestStatus = e
  682. console.log(e)
  683. },
  684. //过滤器
  685. filter(e) {
  686. this.$refs.form.filter = e
  687. console.log(e)
  688. },
  689. specialCaseOfPressureRegulatingFacilities(e) {
  690. this.$refs.form.specialCaseOfPressureRegulatingFacilities = e
  691. console.log(e)
  692. },
  693. overdueInspectionDays(e) {
  694. this.$refs.form.overdueInspectionDays = e
  695. console.log(e)
  696. },
  697. reasonForOverdueInspection(e) {
  698. this.$refs.form.reasonForOverdueInspection = e
  699. console.log(e)
  700. },
  701. xtv(e) {
  702. this.form.xtv = e[0].value
  703. this.xtvLabel = e[0].label
  704. console.log(this.xtvLabel)
  705. },
  706. valveWellCondition(e) {
  707. this.form.valveWellCondition = e[0].value
  708. this.valveWellConditioLabel = e[0].label
  709. console.log(this.$refs.form.valveWellCondition)
  710. },
  711. save() {
  712. let _this=this
  713. this.form.photoList=this.imgArr
  714. this.form.unitId=this.unit
  715. service.setregulatorBox(this.form
  716. ).then(res => {
  717. console.log(res)
  718. _this.$UTILS.showPrompt('上报成功!')
  719. setTimeout(()=>{
  720. console.log('跳')
  721. uni.switchTab({
  722. url:'/pages/index/index'
  723. })
  724. },2000)
  725. })
  726. },
  727. choose() {
  728. let _this = this;
  729. uni.showActionSheet({
  730. title: '上传',
  731. itemList: ['图片', '视频'],
  732. success: (res) => {
  733. // console.log(res)
  734. if (res.tapIndex == 0) {
  735. this.chooseimage()
  736. } else {
  737. this.choosevideo()
  738. }
  739. }
  740. })
  741. },
  742. chooseimage() {
  743. console.log('图片')
  744. let _this = this;
  745. uni.chooseImage({
  746. sizeType: ['camera'],
  747. success(resp) {
  748. console.log('res--uni.chooseMedia', resp);
  749. resp.tempFiles.forEach((item, index) => {
  750. const task = uni.uploadFile({
  751. url: _this.$HTTP.webUrl + `/obs`,
  752. filePath: item.path,
  753. name: 'file',
  754. formData: {},
  755. header: _this.headers,
  756. success: res => {
  757. // 判断是否json字符串,将其转为json格式
  758. let data = _this.$u.test.jsonString(res
  759. .data) ? JSON.parse(res.data) : res.data;
  760. if (![200, 201, 204].includes(res.statusCode)) {
  761. // this.uploadError(index, data);
  762. _this.$UTILS.showPrompt('选取失败!')
  763. } else {
  764. // 上传成功
  765. // this.lists[index].response = data;
  766. // this.lists[index].progress = 100;
  767. // this.lists[index].error = false;
  768. // this.$emit('on-success', data, index, this.lists, this
  769. // .index);
  770. if (_this.progress === 100) {
  771. // console.log('_this.progress', _this.progress)
  772. // console.log('data----', data)
  773. // console.log('res--', res)
  774. _this.imgymxs.push({
  775. url: data.data.url,
  776. type: 'image'
  777. })
  778. _this.imgArr.push(data.data.url)
  779. // console.log('imgArr', _this.imgArr)
  780. _this.$UTILS.showPrompt('选取成功!')
  781. }
  782. }
  783. },
  784. fail: e => {
  785. _this.$UTILS.showPrompt('选取失败!')
  786. this.uploadError(index, e);
  787. },
  788. complete: res => {
  789. _this.uploading = false;
  790. // _this.uploadFile(index + 1);
  791. // this.$emit('on-change', res, index, this.lists, this
  792. // .index);
  793. }
  794. });
  795. task.onProgressUpdate(res => {
  796. // if (res.progress > 0) {
  797. // this.lists[index].progress = res.progress;
  798. // this.$emit('on-progress', res, index, this.lists, this.index);
  799. // }
  800. _this.progress = res.progress;
  801. console.log('onProgressUpdate', res)
  802. uni.showLoading({
  803. title: '选取中'
  804. })
  805. });
  806. })
  807. },
  808. })
  809. },
  810. choosevideo() {
  811. let _this = this;
  812. console.log('视频')
  813. uni.chooseVideo({
  814. sourceType: ['camera'],
  815. maxDuration: 30,
  816. success(resp) {
  817. const task = uni.uploadFile({
  818. url: _this.$HTTP.webUrl + `/obs`,
  819. filePath: resp.tempFilePath,
  820. name: 'file',
  821. formData: {},
  822. header: _this.headers,
  823. success: res => {
  824. // 判断是否json字符串,将其转为json格式
  825. let data = _this.$u.test.jsonString(res
  826. .data) ? JSON.parse(res.data) : res.data;
  827. if (![200, 201, 204].includes(res.statusCode)) {
  828. this.uploadError(index, data);
  829. } else {
  830. // 上传成功
  831. // this.lists[index].response = data;
  832. // this.lists[index].progress = 100;
  833. // this.lists[index].error = false;
  834. // this.$emit('on-success', data, index, this.lists, this
  835. // .index);
  836. if (_this.progress === 100) {
  837. console.log('_this.progress', _this.progress)
  838. console.log('data----', data)
  839. console.log('res--', res)
  840. // _this.imgArr.push(data.data.url)
  841. _this.imgymxs.push({
  842. url: data.data.url,
  843. type: 'video'
  844. })
  845. _this.imgArr.push(data.data.url)
  846. console.log('imgArr', _this.imgArr)
  847. _this.$UTILS.showPrompt('选取成功!')
  848. }
  849. }
  850. },
  851. fail: e => {
  852. _this.$UTILS.showPrompt('选取失败!')
  853. this.uploadError(index, e);
  854. },
  855. complete: res => {
  856. uni.hideLoading();
  857. _this.uploading = false;
  858. // _this.uploadFile(index + 1);
  859. // this.$emit('on-change', res, index, this.lists, this
  860. // .index);
  861. }
  862. });
  863. task.onProgressUpdate(res => {
  864. // if (res.progress > 0) {
  865. // this.lists[index].progress = res.progress;
  866. // this.$emit('on-progress', res, index, this.lists, this.index);
  867. // }
  868. _this.progress = res.progress;
  869. console.log('onProgressUpdate', res)
  870. uni.showLoading({
  871. title: '选取中'
  872. })
  873. });
  874. },
  875. })
  876. },
  877. remove(index) {
  878. uni.showModal({
  879. title: '提示',
  880. content: '是否删除该图片或视频?',
  881. success: (res) => {
  882. if (res.confirm) {
  883. this.imgArr.splice(index, 1);
  884. this.imgymxs.splice(index, 1);
  885. console.log('this.imgArr', this.imgArr)
  886. }
  887. }
  888. })
  889. },
  890. }
  891. }
  892. </script>
  893. <style>
  894. .project-content {
  895. padding: 0rpx 20rpx;
  896. border-radius: 20rpx;
  897. width: 90%;
  898. margin: 0 auto;
  899. background: #fff;
  900. }
  901. .background {
  902. z-index: -1;
  903. position: fixed;
  904. width: 100%;
  905. height: 100%;
  906. background-size: 100% 100%;
  907. }
  908. .top-left{
  909. display: flex;
  910. align-items: center;
  911. }
  912. .small-title{
  913. font-size: 38rpx;
  914. color: #2d95f4;
  915. margin: 20rpx 0;
  916. }
  917. .form-item {
  918. display: flex;
  919. align-items: center;
  920. font-size: 32rpx;
  921. border: none;
  922. }
  923. .danwei{
  924. text-align: center;
  925. line-height: 110rpx;
  926. }
  927. .un-row{
  928. text-align: left;
  929. }
  930. .top{
  931. display: flex;
  932. align-items:center;
  933. justify-content:space-between;
  934. }
  935. .top-icon{
  936. font-size: 40rpx;
  937. color: #2d95f4;
  938. }
  939. </style>