PressureRegulatingBox.vue 28 KB

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