orderprocessreport.vue 65 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231
  1. <!--
  2. * @Title:
  3. * @Description: 维修任务填报提交页
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="container">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view style="width: 100%;display: flex;flex-direction: row;justify-content: center;align-items: center;">
  14. <text style="color: white;font-size: 1rem;">{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <uni-forms ref="baseForm" :model="formData">
  18. <uni-section title="维修前情况" ftitleFontSize="0.8rem" style="width: 100%;">
  19. <template v-slot:decoration>
  20. <view class="decoration"></view>
  21. </template>
  22. <view style="padding-top: 10px;padding-bottom: 0px;padding-left: 15px;padding-right: 15px;">
  23. <uni-forms-item name="networkSignalStatus" label="手机网络信号" label-width="130px" required>
  24. <uni-data-checkbox v-model="formData.networkSignalStatus" :localdata="ispItems.items">
  25. </uni-data-checkbox>
  26. </uni-forms-item>
  27. <uni-forms-item name='networkPayer' label="物联网卡运营商" label-width="130px">
  28. <uni-easyinput disabled :styles="styles" v-model="formData.networkPayer"
  29. placeholder="请录入物联网卡运营商名称" />
  30. </uni-forms-item>
  31. <uni-forms-item name='networkSimId' label="物联网卡号" label-width="130px">
  32. <uni-easyinput disabled :styles="styles" v-model="formData.networkSimId"
  33. placeholder="请录入物联网卡号" />
  34. </uni-forms-item>
  35. </view>
  36. <view style="padding-left: 15px;padding-right: 15px;padding-top: 0px;padding-bottom: 10px;">
  37. <view style="margin-top: 0px;color: gray;font-size: 0.7rem;"><span style="color:red;">*</span>维修前照片
  38. </view>
  39. <view class="view-flex-rs" style="margin-top: 0px;">
  40. <view class="view-flex-cc" style="width: 120px;">
  41. <view class="img-container">
  42. <view class="note-image-box">
  43. <view v-if="baseInfo.beforePhoto1Take" class="note-image-item">
  44. <view class="close-icon" @click="onBaseBeforePhoto1DeleteClick()">
  45. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  46. </view>
  47. <view class="image-box">
  48. <image :src="toOss(baseInfo.beforePhoto1Url)" mode="widthFix"></image>
  49. </view>
  50. </view>
  51. <view v-else class="note-image-item" @click="getBaseBeforePhoto1()">
  52. <view class="image-box">
  53. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="view-flex-cc" style="width: 120px;">
  60. <view class="img-container">
  61. <view class="note-image-box">
  62. <view v-if="baseInfo.beforePhoto2Take" class="note-image-item">
  63. <view class="close-icon" @click="onBaseBeforePhoto2DeleteClick()">
  64. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  65. </view>
  66. <view class="image-box">
  67. <image :src="toOss(baseInfo.beforePhoto2Url)" mode="widthFix"></image>
  68. </view>
  69. </view>
  70. <view v-else class="note-image-item" @click="getBaseBeforePhoto2()">
  71. <view class="image-box">
  72. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </uni-section>
  81. <uni-section title="RTU设备" ftitleFontSize="0.8rem" style="width: 100%;">
  82. <template v-slot:decoration>
  83. <view class="decoration"></view>
  84. </template>
  85. <view style="padding-top: 10px;padding-bottom: 10px;padding-left: 15px;padding-right: 15px;">
  86. <uni-forms-item name="rtuStatus" label="运行状态" label-width="130px" required>
  87. <uni-data-checkbox v-model="formData.rtuStatus" :localdata="rtuInfo.runStatus.items">
  88. </uni-data-checkbox>
  89. </uni-forms-item>
  90. <uni-forms-item name="rtuReplace" label="是否更换RTU" label-width="130px" required>
  91. <uni-data-checkbox v-model="formData.rtuReplace" :localdata="rtuInfo.replaceItems.items">
  92. </uni-data-checkbox>
  93. </uni-forms-item>
  94. <view v-if="formData.rtuReplace==1">
  95. <uni-forms-item name="rtuBrand" label="品牌" label-width="130px" required>
  96. <uni-easyinput v-model="formData.rtuBrand" placeholder="请录入品牌" />
  97. </uni-forms-item>
  98. <uni-forms-item name="rtuModel" label="型号" label-width="130px" required>
  99. <uni-easyinput v-model="formData.rtuModel" placeholder="请录入型号" />
  100. </uni-forms-item>
  101. </view>
  102. <uni-forms-item>
  103. <uni-easyinput type="textarea" v-model="formData.rtuDesc" placeholder="请输入RTU设备维修说明"
  104. @input="rtuRemarkInput" />
  105. </uni-forms-item>
  106. <view style="color: gray;font-size: 0.7rem;"><span style="color:red;">*</span>RTU设备照片</view>
  107. <view class="view-flex-rs">
  108. <view class="view-flex-cc" style="width: 120px;">
  109. <view class="img-container">
  110. <view class="note-image-box">
  111. <view v-if="rtuInfo.photoTake" class="note-image-item">
  112. <view class="close-icon" @click="onRtuPhotoDeleteClick()">
  113. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  114. </view>
  115. <view class="image-box">
  116. <image :src="toOss(rtuInfo.photoUrl)" mode="widthFix"></image>
  117. </view>
  118. </view>
  119. <view v-else class="note-image-item" @click="getRtuPhoto()">
  120. <view class="image-box">
  121. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </uni-section>
  130. <uni-section title="设备传感器信息">
  131. <template v-slot:decoration>
  132. <view class="decoration"></view>
  133. </template>
  134. <view style="padding-top: 10px;padding-left: 15px;padding-right: 15px;">
  135. <uni-forms-item name="sensorList" label="传感器选择" label-width="130px" required>
  136. <uni-data-checkbox multiple v-model="formData.sensorList" :localdata="sensorItems.items"
  137. @change="sensorCheckboxChange"></uni-data-checkbox>
  138. </uni-forms-item>
  139. </view>
  140. <uni-card v-if="sensorList.rainSensor==1" title="雨量传感器">
  141. <uni-forms-item name="rainSensorStatus" label="运行状态" label-width="130px" required>
  142. <uni-data-checkbox v-model="formData.rainSensorStatus"
  143. :localdata="rainSensorInfo.runStatus.items"></uni-data-checkbox>
  144. </uni-forms-item>
  145. <uni-forms-item name="rainSensorReplace" label="是否更换雨量计" label-width="130px" required>
  146. <uni-data-checkbox v-model="formData.rainSensorReplace"
  147. :localdata="rainSensorInfo.replaceItems.items"></uni-data-checkbox>
  148. </uni-forms-item>
  149. <uni-forms-item name="rainSensorBrand" v-if="formData.rainSensorReplace==1" label="品牌"
  150. label-width="130px" required>
  151. <uni-easyinput v-model="formData.rainSensorBrand" placeholder="请录入品牌" />
  152. </uni-forms-item>
  153. <uni-forms-item name="rainSensorModel" v-if="formData.rainSensorReplace==1" label="型号"
  154. label-width="130px" required>
  155. <uni-easyinput v-model="formData.rainSensorModel" placeholder="请录入型号" />
  156. </uni-forms-item>
  157. <uni-forms-item>
  158. <uni-easyinput label="备注说明" type="textarea" v-model="formData.rainSensorDesc"
  159. placeholder="请输入雨量传感器维修说明" @input="rainSensorRemarkInput" />
  160. </uni-forms-item>
  161. <view style="margin-left: 0px;color: gray;font-size: 0.7rem;"><span
  162. style="color:red;">*</span>雨量传感器照片</view>
  163. <view class="view-flex-rs" style="margin-top: 0px;">
  164. <view class="view-flex-cc" style="width: 120px;">
  165. <view class="img-container">
  166. <view class="note-image-box">
  167. <view v-if="rainSensorInfo.photoTake" class="note-image-item">
  168. <view class="close-icon" @click="onRainPhotoDeleteClick()">
  169. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  170. </view>
  171. <view class="image-box">
  172. <image :src="toOss(rainSensorInfo.photoUrl)" mode="widthFix">
  173. </image>
  174. </view>
  175. </view>
  176. <view v-else class="note-image-item" @click="getRainSensorPhoto()">
  177. <view class="image-box">
  178. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  179. </view>
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. </view>
  185. </uni-card>
  186. <uni-card v-if="sensorList.waterSensor==1" title="水位传感器">
  187. <uni-forms-item name="waterLevelSensorStatus" label="运行状态" label-width="130px" required>
  188. <uni-data-checkbox v-model="formData.waterLevelSensorStatus"
  189. :localdata="waterSensorInfo.runStatus.items"></uni-data-checkbox>
  190. </uni-forms-item>
  191. <uni-forms-item name="waterSensorReplace" label="是否更换水位计" label-width="130px" required>
  192. <uni-data-checkbox v-model="formData.waterSensorReplace"
  193. :localdata="waterSensorInfo.replaceItems.items"></uni-data-checkbox>
  194. </uni-forms-item>
  195. <uni-forms-item name="waterSensorBrand" v-if="formData.waterSensorReplace==1" label="品牌"
  196. label-width="130px" required>
  197. <uni-easyinput v-model="formData.waterSensorBrand" placeholder="请录入品牌" />
  198. </uni-forms-item>
  199. <uni-forms-item name="waterSensorModel" v-if="formData.waterSensorReplace==1" label="型号"
  200. label-width="130px" required>
  201. <uni-easyinput v-model="formData.waterSensorModel" placeholder="请录入型号" />
  202. </uni-forms-item>
  203. <uni-forms-item>
  204. <uni-easyinput label="备注说明" type="textarea" v-model="formData.waterSensorDesc"
  205. placeholder="请输入水位传感器维修说明" @input="waterSensorRemarkInput" />
  206. </uni-forms-item>
  207. <view style="margin-left: 0px;color: gray;font-size: 0.7rem;"><span
  208. style="color:red;">*</span>水位传感器照片</view>
  209. <view class="view-flex-rs" style="margin-top: 0px;">
  210. <view class="view-flex-cc" style="width: 120px;">
  211. <view class="img-container">
  212. <view class="note-image-box">
  213. <view v-if="waterSensorInfo.photoTake" class="note-image-item">
  214. <view class="close-icon" @click="onWaterPhotoDeleteClick()">
  215. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  216. </view>
  217. <view class="image-box">
  218. <image :src="toOss(waterSensorInfo.photoUrl)" mode="widthFix">
  219. </image>
  220. </view>
  221. </view>
  222. <view v-else class="note-image-item" @click="getWaterSensorPhoto()">
  223. <view class="image-box">
  224. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  225. </view>
  226. </view>
  227. </view>
  228. </view>
  229. </view>
  230. </view>
  231. </uni-card>
  232. <uni-card v-if="sensorList.groundSensor==1" title="墒情传感器">
  233. <uni-forms-item name="groundWaterSensorStatus" label="运行状态" label-width="130px" required>
  234. <uni-data-checkbox v-model="formData.groundWaterSensorStatus"
  235. :localdata="groundSensorInfo.runStatus.items"></uni-data-checkbox>
  236. </uni-forms-item>
  237. <uni-forms-item name="groundSensorReplace" label="是否更换墒情传感器" label-width="130px" required>
  238. <uni-data-checkbox v-model="formData.groundSensorReplace"
  239. :localdata="groundSensorInfo.replaceItems.items"></uni-data-checkbox>
  240. </uni-forms-item>
  241. <uni-forms-item name="groundSensorBrand" v-if="formData.groundSensorReplace==1" label="品牌"
  242. label-width="130px" required>
  243. <uni-easyinput v-model="formData.groundSensorBrand" placeholder="请录入品牌" />
  244. </uni-forms-item>
  245. <uni-forms-item name="groundSensorModel" v-if="formData.groundSensorReplace==1" label="型号"
  246. label-width="130px" required>
  247. <uni-easyinput v-model="formData.groundSensorModel" placeholder="请录入型号" />
  248. </uni-forms-item>
  249. <uni-forms-item>
  250. <uni-easyinput label="备注说明" type="textarea" v-model="formData.groundSensorDesc"
  251. placeholder="请输入墒情传感器维修说明" @input="groundSensorRemarkInput" />
  252. </uni-forms-item>
  253. <view style="margin-left: 0px;color: gray;font-size: 0.7rem;"><span
  254. style="color:red;">*</span>墒情传感器照片</view>
  255. <view class="view-flex-rs" style="margin-top: 0px;">
  256. <view class="view-flex-cc" style="width: 120px;">
  257. <view class="img-container">
  258. <view class="note-image-box">
  259. <view v-if="groundSensorInfo.photoTake" class="note-image-item">
  260. <view class="close-icon" @click="onGroundPhotoDeleteClick()">
  261. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  262. </view>
  263. <view class="image-box">
  264. <image :src="toOss(groundSensorInfo.photoUrl)" mode="widthFix">
  265. </image>
  266. </view>
  267. </view>
  268. <view v-else class="note-image-item" @click="getGroundSensorPhoto()">
  269. <view class="image-box">
  270. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  271. </view>
  272. </view>
  273. </view>
  274. </view>
  275. </view>
  276. </view>
  277. </uni-card>
  278. </uni-section>
  279. <uni-section title="供电系统" ftitleFontSize="0.8rem" style="width: 100%;">
  280. <template v-slot:decoration>
  281. <view class="decoration"></view>
  282. </template>
  283. <view style="padding-top: 10px;padding-bottom: 10px;padding-left: 15px;padding-right: 15px;">
  284. <uni-forms-item name="batteryReplace" label="是否更换蓄电池" label-width="130px" required>
  285. <uni-data-checkbox v-model="formData.batteryReplace"
  286. :localdata="powerInfo.batteryReplaceItems.items"></uni-data-checkbox>
  287. </uni-forms-item>
  288. <uni-forms-item name="sunPowerReplace" label="是否更换太阳能板" label-width="130px" required>
  289. <uni-data-checkbox v-model="formData.sunPowerReplace"
  290. :localdata="powerInfo.sunPowerReplaceItems.items"></uni-data-checkbox>
  291. </uni-forms-item>
  292. <uni-forms-item name="powerStatus" label="运行状态" label-width="130px" required>
  293. <uni-data-checkbox v-model="formData.powerStatus" :localdata="powerInfo.runStatus.items">
  294. </uni-data-checkbox>
  295. </uni-forms-item>
  296. <uni-forms-item>
  297. <uni-easyinput type="textarea" v-model="formData.powerDesc" placeholder="请输入供电系统维修说明"
  298. @input="powerRemarkInput" />
  299. </uni-forms-item>
  300. <view style="color: gray;font-size: 0.7rem;"><span style="color:red;">*</span>供电系统照片</view>
  301. <view class="view-flex-rs">
  302. <view class="view-flex-cc" style="width: 120px;">
  303. <view class="img-container">
  304. <view class="note-image-box">
  305. <view v-if="powerInfo.batteryPhotoTake" class="note-image-item">
  306. <view class="close-icon" @click="onBatteryPhotoDeleteClick()">
  307. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  308. </view>
  309. <view class="image-box">
  310. <image :src="toOss(powerInfo.batteryPhotoUrl)" mode="widthFix"></image>
  311. </view>
  312. </view>
  313. <view v-else class="note-image-item" @click="getBatteryPhoto()">
  314. <view class="image-box">
  315. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  316. </view>
  317. </view>
  318. </view>
  319. </view>
  320. </view>
  321. <view class="view-flex-cc" style="width: 120px;">
  322. <view class="img-container">
  323. <view class="note-image-box">
  324. <view v-if="powerInfo.sunPhotoTake" class="note-image-item">
  325. <view class="close-icon" @click="onSunPowerPhotoDeleteClick()">
  326. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  327. </view>
  328. <view class="image-box">
  329. <image :src="toOss(powerInfo.sunPhotoUrl)" mode="widthFix"></image>
  330. </view>
  331. </view>
  332. <view v-else class="note-image-item" @click="getSunPowerPhoto()">
  333. <view class="image-box">
  334. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  335. </view>
  336. </view>
  337. </view>
  338. </view>
  339. </view>
  340. </view>
  341. </view>
  342. </uni-section>
  343. <uni-section title="通信网络" ftitleFontSize="0.8rem" style="width: 100%;">
  344. <template v-slot:decoration>
  345. <view class="decoration"></view>
  346. </template>
  347. <view style="padding-left: 15px;padding-right: 15px;padding-top: 10px;padding-bottom: 10px;">
  348. <uni-forms-item name="networkType" label="网络类型选择" label-width="130px" required>
  349. <uni-data-checkbox v-model="formData.networkType" :localdata="networkType.items">
  350. </uni-data-checkbox>
  351. </uni-forms-item>
  352. <view v-if="formData.networkType==0">
  353. <uni-forms-item name="networkStatus" label="运行状态" label-width="130px" required>
  354. <uni-data-checkbox v-model="formData.networkStatus"
  355. :localdata="networkInfo.runStatus.items"></uni-data-checkbox>
  356. </uni-forms-item>
  357. <uni-forms-item name="networkOverdue" label="是否欠费" label-width="130px" required>
  358. <uni-data-checkbox v-model="formData.networkOverdue"
  359. :localdata="networkInfo.overdueItems.items"></uni-data-checkbox>
  360. </uni-forms-item>
  361. <uni-easyinput type="textarea" v-model="formData.networkDesc" placeholder="请输入4G移动网络维修说明"
  362. @input="networkRemarkInput" />
  363. </view>
  364. <view v-if="formData.networkType==1">
  365. <uni-forms-item name="satelliteStatus" label="运行状态" label-width="130px" required>
  366. <uni-data-checkbox v-model="formData.satelliteStatus"
  367. :localdata="satelliteInfo.runStatus.items"></uni-data-checkbox>
  368. </uni-forms-item>
  369. <uni-easyinput type="textarea" v-model="formData.satelliteDesc" placeholder="请输入北斗通讯网络维修说明"
  370. @input="satelliteRemarkInput" />
  371. </view>
  372. </view>
  373. </uni-section>
  374. <uni-section title="维修总结情况" titleFontSize="0.8rem" style="width: 100%;">
  375. <template v-slot:decoration>
  376. <view class="decoration"></view>
  377. </template>
  378. <view style="padding-left: 15px;padding-right: 15px;padding-top: 10px;padding-bottom: 10px;">
  379. <uni-easyinput type="textarea" v-model="formData.processDesc" placeholder="请输入总结说明" />
  380. <view style="margin-top: 10px;color: gray;font-size: 0.7rem;"><span style="color:red;">*</span>维修后照片
  381. </view>
  382. <view class="view-flex-rs">
  383. <view class="view-flex-cc" style="width: 120px;">
  384. <view class="img-container">
  385. <view class="note-image-box">
  386. <view v-if="baseInfo.afterPhoto1Take" class="note-image-item">
  387. <view class="close-icon" @click="onBaseAfterPhoto1DeleteClick()">
  388. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  389. </view>
  390. <view class="image-box">
  391. <image :src="toOss(baseInfo.afterPhoto1Url)" mode="widthFix"></image>
  392. </view>
  393. </view>
  394. <view v-else class="note-image-item" @click="getBaseAfterPhoto1()">
  395. <view class="image-box">
  396. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  397. </view>
  398. </view>
  399. </view>
  400. </view>
  401. </view>
  402. <view class="view-flex-cc" style="width: 120px;">
  403. <view class="img-container">
  404. <view class="note-image-box">
  405. <view v-if="baseInfo.afterPhoto2Take" class="note-image-item">
  406. <view class="close-icon" @click="onBaseAfterPhoto2DeleteClick()">
  407. <uni-icons type="closeempty" size="18" color="#fff"></uni-icons>
  408. </view>
  409. <view class="image-box">
  410. <image :src="toOss(baseInfo.afterPhoto2Url)" mode="widthFix"></image>
  411. </view>
  412. </view>
  413. <view v-else class="note-image-item" @click="getBaseAfterPhoto2()">
  414. <view class="image-box">
  415. <uni-icons type="plusempty" size="50" color="#eee"></uni-icons>
  416. </view>
  417. </view>
  418. </view>
  419. </view>
  420. </view>
  421. </view>
  422. </view>
  423. </uni-section>
  424. </uni-forms>
  425. <view class="footer">
  426. <view class="control">
  427. <view class="view-flex-rc">
  428. <view class="block"
  429. style="width: 120px;height:28px;margin-left: 10px;margin-right: 10px;border-radius:7px;background-color:lightblue"
  430. @click="toSave()">
  431. <view class="view-flex-cc">
  432. <uni-icons class="input-uni-icon" type="folder-add" size="18" color="#999" />
  433. </view>
  434. <view class="view-flex-cc" style="padding-left:5px;">
  435. <text style="color:black;font-size:0.7rem">暂存</text>
  436. </view>
  437. </view>
  438. <view class="block"
  439. style="width: 120px;height:28px;margin-left: 10px;margin-right: 10px;border-radius:7px;background-color:lightpink"
  440. @click="toSubmit()">
  441. <view class="view-flex-cc">
  442. <uni-icons class="input-uni-icon" type="checkmarkempty" size="18" color="#999" />
  443. </view>
  444. <view class="view-flex-cc" style="padding-left:5px;">
  445. <text style="color:black;font-size:0.7rem">立即提交</text>
  446. </view>
  447. </view>
  448. </view>
  449. </view>
  450. </view>
  451. </view>
  452. </template>
  453. <script>
  454. import http from '@/http/api.js';
  455. import {
  456. pathToBase64,
  457. base64ToPath
  458. } from '@/js_sdk/mmmm-image-tools/index.js';
  459. import {
  460. oss,
  461. devUrl,
  462. prodUrl
  463. } from '@/common/setting';
  464. export default {
  465. components: {},
  466. onLoad(options) {
  467. this.orderId = options.orderId;
  468. this.skipPage = options.skipPage;
  469. this.baseURL = process.env.NODE_ENV === 'development' ? devUrl : prodUrl;
  470. this.baseOSS = oss;
  471. this.loadCacheData();
  472. },
  473. data() {
  474. return {
  475. styles: {
  476. color: '#333',
  477. borderColor: '#e5e5e5',
  478. disableColor: '#FFFFFF'
  479. },
  480. formData: {
  481. sensorList: []
  482. },
  483. rules: {
  484. // 手机网络信号选择
  485. networkSignalStatus: {
  486. rules: [{
  487. required: true,
  488. errorMessage: '必填项,请选择手机网络信号',
  489. }]
  490. },
  491. rtuStatus: {
  492. rules: [{
  493. required: true,
  494. errorMessage: '必填项,请选择RTU状态',
  495. }, ]
  496. },
  497. rtuReplace: {
  498. rules: [{
  499. required: true,
  500. errorMessage: '必填项,请选择是否更换RTU',
  501. }, ]
  502. },
  503. rtuBrand: {
  504. rules: [{
  505. required: true,
  506. errorMessage: '必填项,请录入RTU品牌',
  507. }, ]
  508. },
  509. rtuModel: {
  510. rules: [{
  511. required: true,
  512. errorMessage: '必填项,请录入RTU型号',
  513. }, ]
  514. },
  515. sensorList: {
  516. rules: [{
  517. required: true,
  518. errorMessage: '必填项,请至少选择一个传感器',
  519. }, ]
  520. },
  521. rainSensorStatus: {
  522. rules: [{
  523. required: true,
  524. errorMessage: '必填项,请选择雨量计状态',
  525. }]
  526. },
  527. rainSensorReplace: {
  528. rules: [{
  529. required: true,
  530. errorMessage: '必填项,请选择是否更换雨量计',
  531. }, ]
  532. },
  533. rainSensorBrand: {
  534. rules: [{
  535. required: true,
  536. errorMessage: '必填项,请录入雨量计品牌',
  537. }, ]
  538. },
  539. rainSensorModel: {
  540. rules: [{
  541. required: true,
  542. errorMessage: '必填项,请录入雨量计型号',
  543. }, ]
  544. },
  545. waterLevelSensorStatus: {
  546. rules: [{
  547. required: true,
  548. errorMessage: '必填项,请选择水位计状态',
  549. }, ]
  550. },
  551. waterSensorReplace: {
  552. rules: [{
  553. required: true,
  554. errorMessage: '必填项,请选择是否更换水位计',
  555. }, ]
  556. },
  557. waterSensorBrand: {
  558. rules: [{
  559. required: true,
  560. errorMessage: '必填项,请录入水位计品牌',
  561. }, ]
  562. },
  563. waterSensorModel: {
  564. rules: [{
  565. required: true,
  566. errorMessage: '必填项,请录入水位计型号',
  567. }, ]
  568. },
  569. groundWaterSensorStatus: {
  570. rules: [{
  571. required: true,
  572. errorMessage: '必填项,请选择墒情计状态',
  573. }, ]
  574. },
  575. groundSensorReplace: {
  576. rules: [{
  577. required: true,
  578. errorMessage: '必填项,请选择是否更换墒情计',
  579. }, ]
  580. },
  581. groundSensorBrand: {
  582. rules: [{
  583. required: true,
  584. errorMessage: '必填项,请录入墒情计品牌',
  585. }, ]
  586. },
  587. groundSensorModel: {
  588. rules: [{
  589. required: true,
  590. errorMessage: '必填项,请录入墒情计型号',
  591. }, ]
  592. },
  593. batteryReplace: {
  594. rules: [{
  595. required: true,
  596. errorMessage: '必填项,请选择是否更换蓄电池',
  597. }, ]
  598. },
  599. sunPowerReplace: {
  600. rules: [{
  601. required: true,
  602. errorMessage: '必填项,请选择是否更换太阳能板',
  603. }, ]
  604. },
  605. powerStatus: {
  606. rules: [{
  607. required: true,
  608. errorMessage: '必填项,请选择供电系统状态',
  609. }, ]
  610. },
  611. networkType: {
  612. rules: [{
  613. required: true,
  614. errorMessage: '必填项,请选择通信网络类型',
  615. }, ]
  616. },
  617. networkOverdue: {
  618. rules: [{
  619. required: true,
  620. errorMessage: '必填项,请选择是否欠费',
  621. }, ]
  622. },
  623. networkStatus: {
  624. rules: [{
  625. required: true,
  626. errorMessage: '必填项,请选择4G网络状态',
  627. }, ]
  628. },
  629. satelliteStatus: {
  630. rules: [{
  631. required: true,
  632. errorMessage: '必填项,请选择北斗网络状态',
  633. }, ]
  634. },
  635. },
  636. orderId: 0,
  637. skipPage: 1,
  638. pattern: {
  639. color: '#7A7E83',
  640. backgroundColor: '#fff',
  641. selectedColor: '#007AFF',
  642. buttonColor: '#007AFF',
  643. iconColor: '#fff'
  644. },
  645. content: [{
  646. iconPath: '/static/images/user/c6.png',
  647. selectedIconPath: '/static/images/user/c6.png',
  648. text: '提交',
  649. active: false
  650. },
  651. {
  652. iconPath: '/static/images/user/c5.png',
  653. selectedIconPath: '/static/images/user/c5.png',
  654. text: '保存',
  655. active: false
  656. }
  657. ],
  658. baseURL: '',
  659. baseOSS: '',
  660. waterLevelSensorType: {
  661. items: [],
  662. current: -1,
  663. },
  664. groundSensorType: {
  665. items: [],
  666. current: -1,
  667. },
  668. satelliteModel: {
  669. items: [],
  670. current: -1,
  671. },
  672. ispItems: {
  673. items: [{
  674. 'value': 0,
  675. 'text': '正常'
  676. }, {
  677. 'value': 1,
  678. 'text': '三大运营商均无信号'
  679. }],
  680. current: -1,
  681. },
  682. baseInfo: {
  683. processDesc: '',
  684. afterPhoto1Url: '',
  685. afterPhoto1Take: false,
  686. afterPhoto2Url: '',
  687. afterPhoto2Take: false,
  688. beforePhoto1Url: '',
  689. beforePhoto1Take: false,
  690. beforePhoto2Url: '',
  691. beforePhoto2Take: false
  692. },
  693. rtuInfo: {
  694. remark: '',
  695. rtuReplace: 0,
  696. photoUrl: '',
  697. photoTake: false,
  698. replaceItems: {
  699. items: [{
  700. 'value': 0,
  701. 'text': '否'
  702. }, {
  703. 'value': 1,
  704. 'text': '更换'
  705. }],
  706. current: -1,
  707. },
  708. runStatus: {
  709. items: [{
  710. 'value': 0,
  711. 'text': '正常'
  712. }, {
  713. 'value': 1,
  714. 'text': '故障'
  715. }],
  716. current: -1,
  717. },
  718. },
  719. sensorItems: {
  720. items: [{
  721. 'value': 0,
  722. 'checked': false,
  723. 'text': '雨量'
  724. }, {
  725. 'value': 1,
  726. 'checked': false,
  727. 'text': '水位'
  728. }, {
  729. 'value': 2,
  730. 'checked': false,
  731. 'text': '墒情'
  732. }],
  733. current: -1,
  734. },
  735. sensorList: {
  736. rainSensor: 0,
  737. waterSensor: 0,
  738. groundSensor: 0,
  739. },
  740. rainSensorInfo: {
  741. rainSensorReplace: 0,
  742. replaceItems: {
  743. items: [{
  744. 'value': 0,
  745. 'text': '否'
  746. }, {
  747. 'value': 1,
  748. 'text': '更换'
  749. }],
  750. current: -1,
  751. },
  752. remark: '',
  753. photoUrl: '',
  754. photoTake: false,
  755. active: {
  756. items: [{
  757. 'value': 0,
  758. 'text': '有'
  759. }, {
  760. 'value': 1,
  761. 'text': '无'
  762. }],
  763. current: -1,
  764. },
  765. runStatus: {
  766. items: [{
  767. 'value': 0,
  768. 'text': '正常'
  769. }, {
  770. 'value': 1,
  771. 'text': '故障'
  772. }],
  773. current: -1,
  774. },
  775. },
  776. waterSensorInfo: {
  777. waterSensorReplace: 0,
  778. replaceItems: {
  779. items: [{
  780. 'value': 0,
  781. 'text': '否'
  782. }, {
  783. 'value': 1,
  784. 'text': '更换'
  785. }],
  786. current: -1,
  787. },
  788. remark: '',
  789. photoUrl: '',
  790. photoTake: false,
  791. active: {
  792. items: [{
  793. 'value': 0,
  794. 'text': '有'
  795. }, {
  796. 'value': 1,
  797. 'text': '无'
  798. }],
  799. current: -1,
  800. },
  801. runStatus: {
  802. items: [{
  803. 'value': 0,
  804. 'text': '正常'
  805. }, {
  806. 'value': 1,
  807. 'text': '故障'
  808. }],
  809. current: -1,
  810. },
  811. },
  812. groundSensorInfo: {
  813. groundSensorReplace: 0,
  814. replaceItems: {
  815. items: [{
  816. 'value': 0,
  817. 'text': '否'
  818. }, {
  819. 'value': 1,
  820. 'text': '更换'
  821. }],
  822. current: -1,
  823. },
  824. remark: '',
  825. photoUrl: '',
  826. photoTake: false,
  827. active: {
  828. items: [{
  829. 'value': 0,
  830. 'text': '有'
  831. }, {
  832. 'value': 1,
  833. 'text': '无'
  834. }],
  835. current: -1,
  836. },
  837. runStatus: {
  838. items: [{
  839. 'value': 0,
  840. 'text': '正常'
  841. }, {
  842. 'value': 1,
  843. 'text': '故障'
  844. }],
  845. current: -1,
  846. },
  847. },
  848. powerInfo: {
  849. batteryReplace: 0,
  850. batteryReplaceItems: {
  851. items: [{
  852. 'value': 0,
  853. 'text': '否'
  854. }, {
  855. 'value': 1,
  856. 'text': '更换'
  857. }],
  858. current: -1,
  859. },
  860. sunPowerReplace: 0,
  861. sunPowerReplaceItems: {
  862. items: [{
  863. 'value': 0,
  864. 'text': '否'
  865. }, {
  866. 'value': 1,
  867. 'text': '更换'
  868. }],
  869. current: -1,
  870. },
  871. batteryPhotoUrl: '',
  872. batteryPhotoTake: false,
  873. sunPhotoUrl: '',
  874. sunPhotoTake: false,
  875. remark: '',
  876. active: {
  877. items: [{
  878. 'value': 0,
  879. 'text': '有'
  880. }, {
  881. 'value': 1,
  882. 'text': '无'
  883. }],
  884. current: -1,
  885. },
  886. runStatus: {
  887. items: [{
  888. 'value': 0,
  889. 'text': '正常'
  890. }, {
  891. 'value': 1,
  892. 'text': '故障'
  893. }],
  894. current: -1,
  895. },
  896. },
  897. networkType: {
  898. items: [{
  899. 'value': 0,
  900. 'text': '4G网络'
  901. }, {
  902. 'value': 1,
  903. 'text': '北斗网络'
  904. }],
  905. current: -1,
  906. },
  907. networkInfo: {
  908. overdueItems: {
  909. items: [{
  910. 'value': 0,
  911. 'text': '正常'
  912. }, {
  913. 'value': 1,
  914. 'text': '欠费'
  915. }],
  916. current: -1,
  917. },
  918. networkOverdue: 0,
  919. remark: '',
  920. active: {
  921. items: [{
  922. 'value': 0,
  923. 'text': '有'
  924. }, {
  925. 'value': 1,
  926. 'text': '无'
  927. }],
  928. current: -1,
  929. },
  930. runStatus: {
  931. items: [{
  932. 'value': 0,
  933. 'text': '正常'
  934. }, {
  935. 'value': 1,
  936. 'text': '故障'
  937. }],
  938. current: -1,
  939. },
  940. },
  941. satelliteInfo: {
  942. remark: '',
  943. active: {
  944. items: [{
  945. 'value': 0,
  946. 'text': '有'
  947. }, {
  948. 'value': 1,
  949. 'text': '无'
  950. }],
  951. current: -1,
  952. },
  953. runStatus: {
  954. items: [{
  955. 'value': 0,
  956. 'text': '正常'
  957. }, {
  958. 'value': 1,
  959. 'text': '故障'
  960. }],
  961. current: -1,
  962. },
  963. },
  964. networkPayer: '',
  965. networkSimId: '',
  966. localImageList: [],
  967. uploadImageList: [],
  968. title: '维修填报',
  969. desc: '',
  970. }
  971. },
  972. computed: {
  973. getIcon() {
  974. return path => {
  975. return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
  976. }
  977. },
  978. },
  979. onReady() {
  980. console.log("onReady++++++++++++++")
  981. // 需要在onReady中设置规则
  982. this.$refs.baseForm.setRules(this.rules)
  983. },
  984. onShow() {},
  985. created() {},
  986. methods: {
  987. toOss(path) {
  988. let url = this.baseOSS + path;
  989. console.log("tooss " + url)
  990. return url;
  991. },
  992. toBack() {
  993. uni.navigateBack({
  994. delta: Number(this.skipPage)
  995. })
  996. },
  997. getDetail() {
  998. let that = this;
  999. let postData = {};
  1000. postData['id'] = this.orderId;
  1001. http.request({
  1002. url: '/galaxy-business/rtu/check/order/detail',
  1003. method: 'GET',
  1004. data: postData
  1005. }).then(res => {
  1006. let p = {};
  1007. p['networkSimId'] = res.data.networkSimId;
  1008. p['networkPayer'] = res.data.networkPayer;
  1009. that.formData = p;
  1010. }).catch(err => {
  1011. console.log(err)
  1012. })
  1013. },
  1014. loadCacheData() {
  1015. let formdata = uni.getStorageSync('check_report_storage_' + this.orderId);
  1016. if (formdata) {
  1017. this.formData = formdata;
  1018. console.log(JSON.stringify(formdata))
  1019. let baseBeforePhoto1Take = formdata['baseBeforePhoto1Take'];
  1020. if (baseBeforePhoto1Take == 1) {
  1021. this.baseInfo.beforePhoto1Take = true;
  1022. this.baseInfo.beforePhoto1Url = formdata['baseBeforePhoto1Url'];
  1023. } else {
  1024. this.baseInfo.beforePhoto1Take = false;
  1025. }
  1026. let baseBeforePhoto2Take = formdata['baseBeforePhoto2Take'];
  1027. if (baseBeforePhoto2Take == 1) {
  1028. this.baseInfo.beforePhoto2Take = true;
  1029. this.baseInfo.beforePhoto2Url = formdata['baseBeforePhoto2Url'];
  1030. } else {
  1031. this.baseInfo.beforePhoto2Take = false;
  1032. }
  1033. let baseAfterPhoto1Take = formdata['baseAfterPhoto1Take'];
  1034. if (baseAfterPhoto1Take == 1) {
  1035. this.baseInfo.afterPhoto1Take = true;
  1036. this.baseInfo.afterPhoto1Url = formdata['baseAfterPhoto1Url'];
  1037. } else {
  1038. this.baseInfo.afterPhoto1Take = false;
  1039. }
  1040. let baseAfterPhoto2Take = formdata['baseAfterPhoto2Take'];
  1041. if (baseAfterPhoto2Take == 1) {
  1042. this.baseInfo.afterPhoto2Take = true;
  1043. this.baseInfo.afterPhoto2Url = formdata['baseAfterPhoto2Url'];
  1044. } else {
  1045. this.baseInfo.afterPhoto2Take = false;
  1046. }
  1047. let photoTake = formdata['rtuPhotoTake'];
  1048. if (photoTake == 1) {
  1049. this.rtuInfo.photoTake = true;
  1050. this.rtuInfo.photoUrl = formdata['rtuPhotoUrl'];
  1051. } else {
  1052. this.rtuInfo.photoTake = false;
  1053. }
  1054. this.sensorList.rainSensor = formdata['rainSensorActive'];
  1055. photoTake = formdata['rainSensorPhotoTake'];
  1056. if (photoTake == 1) {
  1057. this.rainSensorInfo.photoTake = true;
  1058. this.rainSensorInfo.photoUrl = formdata['rainSensorPhotoUrl'];
  1059. } else {
  1060. this.rainSensorInfo.photoTake = false;
  1061. }
  1062. this.sensorList.waterSensor = formdata['waterLevelSensorActive'];
  1063. photoTake = formdata['waterSensorPhotoTake'];
  1064. if (photoTake == 1) {
  1065. this.waterSensorInfo.photoTake = true;
  1066. this.waterSensorInfo.photoUrl = formdata['waterSensorPhotoUrl'];
  1067. } else {
  1068. this.waterSensorInfo.photoTake = false;
  1069. }
  1070. this.sensorList.groundSensor = formdata['groundWaterSensorActive'];
  1071. photoTake = formdata['groundSensorPhotoTake'];
  1072. if (photoTake == 1) {
  1073. this.groundSensorInfo.photoTake = true;
  1074. this.groundSensorInfo.photoUrl = formdata['groundSensorPhotoUrl'];
  1075. } else {
  1076. this.groundSensorInfo.photoTake = false;
  1077. }
  1078. photoTake = formdata['batteryPhotoTake'];
  1079. if (photoTake == 1) {
  1080. this.powerInfo.batteryPhotoTake = true;
  1081. this.powerInfo.batteryPhotoUrl = formdata['batteryPhotoUrl'];
  1082. } else {
  1083. this.powerInfo.batteryPhotoTake = false;
  1084. }
  1085. photoTake = formdata['sunPhotoTake'];
  1086. if (photoTake == 1) {
  1087. this.powerInfo.sunPhotoTake = true;
  1088. this.powerInfo.sunPhotoUrl = formdata['sunPhotoUrl'];
  1089. } else {
  1090. this.powerInfo.sunPhotoTake = false;
  1091. }
  1092. } else {
  1093. this.getDetail();
  1094. }
  1095. },
  1096. toSubmit() {
  1097. console.log('表单提交');
  1098. let that = this;
  1099. this.$refs.baseForm.validate().then(res => {
  1100. let next = false;
  1101. let msg = '';
  1102. if (that.formData.networkSignalStatus == 0) {
  1103. //检查必填的图片
  1104. if (this.baseInfo.beforePhoto1Take || this.baseInfo.beforePhoto2Take) {
  1105. next = true;
  1106. } else {
  1107. msg = '维修前照片为必填项,请至少拍一张照片,请检查!';
  1108. next = false;
  1109. }
  1110. if (next) {
  1111. if (this.rtuInfo.photoTake) {
  1112. next = true;
  1113. } else {
  1114. msg = 'RTU设备照片为必填项,请检查!';
  1115. next = false;
  1116. }
  1117. }
  1118. if (next) {
  1119. if (this.sensorList.rainSensor == 1) {
  1120. if (this.formData.rainSensorReplace == 1) {
  1121. if (this.rainSensorInfo.photoTake) {
  1122. next = true;
  1123. } else {
  1124. msg = '更换雨量计后,雨量传感器照片为必填项,请检查!';
  1125. next = false;
  1126. }
  1127. }
  1128. }
  1129. }
  1130. if (next) {
  1131. if (this.sensorList.waterSensor == 1) {
  1132. if (this.formData.waterSensorReplace == 1) {
  1133. if (this.waterSensorInfo.photoTake) {
  1134. next = true;
  1135. } else {
  1136. msg = '更换水位计后,水位传感器照片为必填项,请检查!';
  1137. next = false;
  1138. }
  1139. }
  1140. }
  1141. }
  1142. if (next) {
  1143. if (this.sensorList.groundSensor == 1) {
  1144. if (this.formData.groundSensorReplace == 1) {
  1145. if (this.groundSensorInfo.photoTake) {
  1146. next = true;
  1147. } else {
  1148. msg = '更换墒情计后,墒情传感器照片为必填项,请检查!';
  1149. next = false;
  1150. }
  1151. }
  1152. }
  1153. }
  1154. if (next) {
  1155. if (this.powerInfo.batteryPhotoTake || this.powerInfo.sunPhotoTake) {
  1156. next = true;
  1157. } else {
  1158. msg = '供电系统照片为必填项,请至少拍一张照片,请检查!';
  1159. next = false;
  1160. }
  1161. }
  1162. if (next) {
  1163. if (this.baseInfo.afterPhoto1Take || this.baseInfo.afterPhoto2Take) {
  1164. next = true;
  1165. } else {
  1166. msg = '维修后照片为必填项,请至少拍一张照片,请检查!';
  1167. next = false;
  1168. }
  1169. }
  1170. } else {
  1171. next = true;
  1172. }
  1173. if (next) {
  1174. that.submitData();
  1175. } else {
  1176. uni.showModal({
  1177. content: msg,
  1178. showCancel: false,
  1179. success(res) {
  1180. if (res.confirm) {
  1181. }
  1182. }
  1183. });
  1184. }
  1185. }).catch(err => {
  1186. console.log('表单错误信息:', err);
  1187. uni.showModal({
  1188. content: "内容填报错误,请根据提示信息检查录入内容!",
  1189. showCancel: false,
  1190. success(res) {
  1191. if (res.confirm) {
  1192. //that.$refs.baseForm.clearValidate();
  1193. }
  1194. }
  1195. });
  1196. })
  1197. },
  1198. submitData() {
  1199. let formdata = this.formData;
  1200. formdata['orderId'] = this.orderId;
  1201. if (this.baseInfo.beforePhoto1Take) {
  1202. formdata['baseBeforePhoto1Take'] = 1;
  1203. formdata['baseBeforePhoto1Url'] = this.baseInfo.beforePhoto1Url;
  1204. } else {
  1205. formdata['baseBeforePhoto1Take'] = 0;
  1206. }
  1207. if (this.baseInfo.beforePhoto2Take) {
  1208. formdata['baseBeforePhoto2Take'] = 1;
  1209. formdata['baseBeforePhoto2Url'] = this.baseInfo.beforePhoto2Url;
  1210. } else {
  1211. formdata['baseBeforePhoto2Take'] = 0;
  1212. }
  1213. if (this.baseInfo.afterPhoto1Take) {
  1214. formdata['baseAfterPhoto1Take'] = 1;
  1215. formdata['baseAfterPhoto1Url'] = this.baseInfo.afterPhoto1Url;
  1216. } else {
  1217. formdata['baseAfterPhoto1Take'] = 0;
  1218. }
  1219. if (this.baseInfo.afterPhoto2Take) {
  1220. formdata['baseAfterPhoto2Take'] = 1;
  1221. formdata['baseAfterPhoto2Url'] = this.baseInfo.afterPhoto2Url;
  1222. } else {
  1223. formdata['baseAfterPhoto2Take'] = 0;
  1224. }
  1225. if (this.rtuInfo.photoTake) {
  1226. formdata['rtuPhotoTake'] = 1;
  1227. formdata['rtuPhotoUrl'] = this.rtuInfo.photoUrl;
  1228. } else {
  1229. formdata['rtuPhotoTake'] = 0;
  1230. }
  1231. if (this.sensorList.rainSensor == 1) {
  1232. formdata['rainSensorActive'] = 1;
  1233. if (this.rainSensorInfo.photoTake) {
  1234. formdata['rainSensorPhotoTake'] = 1;
  1235. formdata['rainSensorPhotoUrl'] = this.rainSensorInfo.photoUrl;
  1236. } else {
  1237. formdata['rainSensorPhotoTake'] = 0;
  1238. }
  1239. } else {
  1240. formdata['rainSensorActive'] = 0;
  1241. }
  1242. if (this.sensorList.waterSensor == 1) {
  1243. formdata['waterLevelSensorActive'] = 1;
  1244. if (this.waterSensorInfo.photoTake) {
  1245. formdata['waterSensorPhotoTake'] = 1;
  1246. formdata['waterSensorPhotoUrl'] = this.waterSensorInfo.photoUrl;
  1247. } else {
  1248. formdata['waterSensorPhotoTake'] = 0;
  1249. }
  1250. } else {
  1251. formdata['waterLevelSensorActive'] = 0;
  1252. }
  1253. if (this.sensorList.groundSensor == 1) {
  1254. formdata['groundWaterSensorActive'] = 1;
  1255. if (this.groundSensorInfo.photoTake) {
  1256. formdata['groundSensorPhotoTake'] = 1;
  1257. formdata['groundSensorPhotoUrl'] = this.groundSensorInfo.photoUrl;
  1258. } else {
  1259. formdata['groundSensorPhotoTake'] = 0;
  1260. }
  1261. } else {
  1262. formdata['groundWaterSensorActive'] = 0;
  1263. }
  1264. if (this.powerInfo.batteryPhotoTake) {
  1265. formdata['batteryPhotoTake'] = 1;
  1266. formdata['batteryPhotoUrl'] = this.powerInfo.batteryPhotoUrl;
  1267. } else {
  1268. formdata['batteryPhotoTake'] = 0;
  1269. }
  1270. if (this.powerInfo.sunPhotoTake) {
  1271. formdata['sunPhotoTake'] = 1;
  1272. formdata['sunPhotoUrl'] = this.powerInfo.sunPhotoUrl;
  1273. } else {
  1274. formdata['sunPhotoTake'] = 0;
  1275. }
  1276. if (this.formData.networkType == 0) {
  1277. formdata['networkActive'] = 1;
  1278. formdata['satelliteActive'] = 0;
  1279. } else if (this.formData.networkType == 1) {
  1280. formdata['networkActive'] = 0;
  1281. formdata['satelliteActive'] = 1;
  1282. }
  1283. let that = this;
  1284. http.request({
  1285. url: '/galaxy-business/rtu/check/order/process/save',
  1286. method: 'POST',
  1287. data: formdata
  1288. }).then(res => {
  1289. if (res.success) {
  1290. uni.showModal({
  1291. content: '维修填报信息已成功提交',
  1292. showCancel: false,
  1293. success(res) {
  1294. if (res.confirm) {
  1295. that.clearCache();
  1296. that.toBack();
  1297. }
  1298. }
  1299. });
  1300. } else {
  1301. uni.showModal({
  1302. content: '' + res.msg,
  1303. showCancel: false
  1304. });
  1305. }
  1306. }).catch(err => {
  1307. console.log(err)
  1308. })
  1309. },
  1310. toSave() {
  1311. this.saveCacheData();
  1312. },
  1313. saveCacheData() {
  1314. this.formData['orderId'] = this.orderId;
  1315. if (this.baseInfo.beforePhoto1Take) {
  1316. this.formData['baseBeforePhoto1Take'] = 1;
  1317. this.formData['baseBeforePhoto1Url'] = this.baseInfo.beforePhoto1Url;
  1318. } else {
  1319. this.formData['baseBeforePhoto1Take'] = 0;
  1320. }
  1321. if (this.baseInfo.beforePhoto2Take) {
  1322. this.formData['baseBeforePhoto2Take'] = 1;
  1323. this.formData['baseBeforePhoto2Url'] = this.baseInfo.beforePhoto2Url;
  1324. } else {
  1325. this.formData['baseBeforePhoto2Take'] = 0;
  1326. }
  1327. if (this.baseInfo.afterPhoto1Take) {
  1328. this.formData['baseAfterPhoto1Take'] = 1;
  1329. this.formData['baseAfterPhoto1Url'] = this.baseInfo.afterPhoto1Url;
  1330. } else {
  1331. this.formData['baseAfterPhoto1Take'] = 0;
  1332. }
  1333. if (this.baseInfo.afterPhoto2Take) {
  1334. this.formData['baseAfterPhoto2Take'] = 1;
  1335. this.formData['baseAfterPhoto2Url'] = this.baseInfo.afterPhoto2Url;
  1336. } else {
  1337. this.formData['baseAfterPhoto2Take'] = 0;
  1338. }
  1339. if (this.rtuInfo.photoTake) {
  1340. this.formData['rtuPhotoTake'] = 1;
  1341. this.formData['rtuPhotoUrl'] = this.rtuInfo.photoUrl;
  1342. } else {
  1343. this.formData['rtuPhotoTake'] = 0;
  1344. }
  1345. if (this.sensorList.rainSensor == 1) {
  1346. this.formData['rainSensorActive'] = 1;
  1347. if (this.rainSensorInfo.photoTake) {
  1348. this.formData['rainSensorPhotoTake'] = 1;
  1349. this.formData['rainSensorPhotoUrl'] = this.rainSensorInfo.photoUrl;
  1350. } else {
  1351. this.formData['rainSensorPhotoTake'] = 0;
  1352. }
  1353. } else {
  1354. this.formData['rainSensorActive'] = 0;
  1355. }
  1356. if (this.sensorList.waterSensor == 1) {
  1357. this.formData['waterLevelSensorActive'] = 1;
  1358. if (this.waterSensorInfo.photoTake) {
  1359. this.formData['waterSensorPhotoTake'] = 1;
  1360. this.formData['waterSensorPhotoUrl'] = this.waterSensorInfo.photoUrl;
  1361. } else {
  1362. this.formData['waterSensorPhotoTake'] = 0;
  1363. }
  1364. } else {
  1365. this.formData['waterLevelSensorActive'] = 0;
  1366. }
  1367. if (this.sensorList.groundSensor == 1) {
  1368. this.formData['groundWaterSensorActive'] = 1;
  1369. if (this.groundSensorInfo.photoTake) {
  1370. this.formData['groundSensorPhotoTake'] = 1;
  1371. this.formData['groundSensorPhotoUrl'] = this.groundSensorInfo.photoUrl;
  1372. } else {
  1373. this.formData['groundSensorPhotoTake'] = 0;
  1374. }
  1375. } else {
  1376. this.formData['groundWaterSensorActive'] = 0;
  1377. }
  1378. if (this.powerInfo.batteryPhotoTake) {
  1379. this.formData['batteryPhotoTake'] = 1;
  1380. this.formData['batteryPhotoUrl'] = this.powerInfo.batteryPhotoUrl;
  1381. } else {
  1382. this.formData['batteryPhotoTake'] = 0;
  1383. }
  1384. if (this.powerInfo.sunPhotoTake) {
  1385. this.formData['sunPhotoTake'] = 1;
  1386. this.formData['sunPhotoUrl'] = this.powerInfo.sunPhotoUrl;
  1387. } else {
  1388. this.formData['sunPhotoTake'] = 0;
  1389. }
  1390. console.log('save事件:', JSON.stringify(this.formData));
  1391. let that = this;
  1392. uni.setStorageSync('check_report_storage_' + this.orderId, this.formData);
  1393. uni.showModal({
  1394. content: '已成功缓存,确认返回!',
  1395. showCancel: true,
  1396. success(res) {
  1397. if (res.confirm) {
  1398. that.toBack();
  1399. }
  1400. }
  1401. });
  1402. },
  1403. clearCache() {
  1404. uni.removeStorageSync('check_report_storage_' + this.orderId);
  1405. },
  1406. sensorCheckboxChange: function(evt) {
  1407. this.sensorList.rainSensor = 0;
  1408. this.sensorList.waterSensor = 0;
  1409. this.sensorList.groundSensor = 0;
  1410. for (let i = 0; i < evt.detail.value.length; i++) {
  1411. let c = evt.detail.value[i];
  1412. if (c === 0) {
  1413. this.sensorList.rainSensor = 1;
  1414. } else if (c === 1) {
  1415. this.sensorList.waterSensor = 1;
  1416. } else if (c === 2) {
  1417. this.sensorList.groundSensor = 1;
  1418. }
  1419. }
  1420. },
  1421. rtuRemarkInput(e) {
  1422. console.log(JSON.stringify(e))
  1423. let desc = "";
  1424. desc += "RTU设备维修说明:" + e;
  1425. if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
  1426. if (desc.length > 0) {
  1427. desc += ",\n";
  1428. }
  1429. desc += "雨量传感器维修说明:" + this.formData.rainSensorDesc;
  1430. }
  1431. if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
  1432. if (desc.length > 0) {
  1433. desc += ",\n";
  1434. }
  1435. desc += "水位传感器维修说明:" + this.formData.waterSensorDesc;
  1436. }
  1437. if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
  1438. if (desc.length > 0) {
  1439. desc += ",\n";
  1440. }
  1441. desc += "墒情传感器维修说明:" + this.formData.groundSensorDesc;
  1442. }
  1443. if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
  1444. if (desc.length > 0) {
  1445. desc += ",\n";
  1446. }
  1447. desc += "供电维修说明:" + this.formData.powerDesc;
  1448. }
  1449. if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
  1450. if (desc.length > 0) {
  1451. desc += ",\n";
  1452. }
  1453. desc += "4G网络维修说明:" + this.formData.networkDesc;
  1454. }
  1455. if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
  1456. if (desc.length > 0) {
  1457. desc += ",\n";
  1458. }
  1459. desc += "北斗维修说明:" + this.formData.satelliteDesc;
  1460. }
  1461. this.formData.processDesc = desc;
  1462. },
  1463. rainSensorRemarkInput(e) {
  1464. let desc = "";
  1465. if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
  1466. desc += "RTU设备维修说明:" + this.formData.rtuDesc;
  1467. }
  1468. if (desc.length > 0) {
  1469. desc += ",\n";
  1470. }
  1471. desc += "雨量传感器维修说明:" + e;
  1472. if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
  1473. if (desc.length > 0) {
  1474. desc += ",\n";
  1475. }
  1476. desc += "水位传感器维修说明:" + this.formData.waterSensorDesc;
  1477. }
  1478. if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
  1479. if (desc.length > 0) {
  1480. desc += ",\n";
  1481. }
  1482. desc += "墒情传感器维修说明:" + this.formData.groundSensorDesc;
  1483. }
  1484. if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
  1485. if (desc.length > 0) {
  1486. desc += ",\n";
  1487. }
  1488. desc += "供电维修说明:" + this.formData.powerDesc;
  1489. }
  1490. if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
  1491. if (desc.length > 0) {
  1492. desc += ",\n";
  1493. }
  1494. desc += "4G网络维修说明:" + this.formData.networkDesc;
  1495. }
  1496. if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
  1497. if (desc.length > 0) {
  1498. desc += ",\n";
  1499. }
  1500. desc += "北斗维修说明:" + this.formData.satelliteDesc;
  1501. }
  1502. this.formData.processDesc = desc;
  1503. },
  1504. waterSensorRemarkInput(e) {
  1505. let desc = "";
  1506. if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
  1507. desc += "RTU设备维修说明:" + this.formData.rtuDesc;
  1508. }
  1509. if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
  1510. if (desc.length > 0) {
  1511. desc += ",\n";
  1512. }
  1513. desc += "雨量传感器维修说明:" + this.formData.rainSensorDesc;
  1514. }
  1515. if (desc.length > 0) {
  1516. desc += ",\n";
  1517. }
  1518. desc += "水位传感器维修说明:" + e;
  1519. if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
  1520. if (desc.length > 0) {
  1521. desc += ",\n";
  1522. }
  1523. desc += "墒情传感器维修说明:" + this.formData.groundSensorDesc;
  1524. }
  1525. if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
  1526. if (desc.length > 0) {
  1527. desc += ",\n";
  1528. }
  1529. desc += "供电维修说明:" + this.formData.powerDesc;
  1530. }
  1531. if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
  1532. if (desc.length > 0) {
  1533. desc += ",\n";
  1534. }
  1535. desc += "4G网络维修说明:" + this.formData.networkDesc;
  1536. }
  1537. if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
  1538. if (desc.length > 0) {
  1539. desc += ",\n";
  1540. }
  1541. desc += "北斗维修说明:" + this.formData.satelliteDesc;
  1542. }
  1543. this.formData.processDesc = desc;
  1544. },
  1545. groundSensorRemarkInput(e) {
  1546. let desc = "";
  1547. if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
  1548. desc += "RTU设备维修说明:" + this.formData.rtuDesc;
  1549. }
  1550. if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
  1551. if (desc.length > 0) {
  1552. desc += ",\n";
  1553. }
  1554. desc += "雨量传感器维修说明:" + this.formData.rainSensorDesc;
  1555. }
  1556. if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
  1557. if (desc.length > 0) {
  1558. desc += ",\n";
  1559. }
  1560. desc += "水位传感器维修说明:" + this.formData.waterSensorDesc;
  1561. }
  1562. if (desc.length > 0) {
  1563. desc += ",\n";
  1564. }
  1565. desc += "墒情传感器维修说明:" + e;
  1566. if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
  1567. if (desc.length > 0) {
  1568. desc += ",\n";
  1569. }
  1570. desc += "供电维修说明:" + this.formData.powerDesc;
  1571. }
  1572. if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
  1573. if (desc.length > 0) {
  1574. desc += ",\n";
  1575. }
  1576. desc += "4G网络维修说明:" + this.formData.networkDesc;
  1577. }
  1578. if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
  1579. if (desc.length > 0) {
  1580. desc += ",\n";
  1581. }
  1582. desc += "北斗维修说明:" + this.formData.satelliteDesc;
  1583. }
  1584. this.formData.processDesc = desc;
  1585. },
  1586. powerRemarkInput(e) {
  1587. let desc = "";
  1588. if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
  1589. desc += "RTU设备维修说明:" + this.formData.rtuDesc;
  1590. }
  1591. if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
  1592. if (desc.length > 0) {
  1593. desc += ",\n";
  1594. }
  1595. desc += "雨量传感器维修说明:" + this.formData.rainSensorDesc;
  1596. }
  1597. if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
  1598. if (desc.length > 0) {
  1599. desc += ",\n";
  1600. }
  1601. desc += "水位传感器维修说明:" + this.formData.waterSensorDesc;
  1602. }
  1603. if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
  1604. if (desc.length > 0) {
  1605. desc += ",\n";
  1606. }
  1607. desc += "墒情传感器维修说明:" + this.formData.groundSensorDesc;
  1608. }
  1609. if (desc.length > 0) {
  1610. desc += ",\n";
  1611. }
  1612. desc += "供电维修说明:" + e;
  1613. if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
  1614. if (desc.length > 0) {
  1615. desc += ",\n";
  1616. }
  1617. desc += "4G网络维修说明:" + this.formData.networkDesc;
  1618. }
  1619. if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
  1620. if (desc.length > 0) {
  1621. desc += ",\n";
  1622. }
  1623. desc += "北斗维修说明:" + this.formData.satelliteDesc;
  1624. }
  1625. this.formData.processDesc = desc;
  1626. },
  1627. networkRemarkInput(e) {
  1628. let desc = "";
  1629. if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
  1630. desc += "RTU设备维修说明:" + this.formData.rtuDesc;
  1631. }
  1632. if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
  1633. if (desc.length > 0) {
  1634. desc += ",\n";
  1635. }
  1636. desc += "雨量传感器维修说明:" + this.formData.rainSensorDesc;
  1637. }
  1638. if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
  1639. if (desc.length > 0) {
  1640. desc += ",\n";
  1641. }
  1642. desc += "水位传感器维修说明:" + this.formData.waterSensorDesc;
  1643. }
  1644. if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
  1645. if (desc.length > 0) {
  1646. desc += ",\n";
  1647. }
  1648. desc += "墒情传感器维修说明:" + this.formData.groundSensorDesc;
  1649. }
  1650. if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
  1651. if (desc.length > 0) {
  1652. desc += ",\n";
  1653. }
  1654. desc += "供电维修说明:" + this.formData.powerDesc;
  1655. }
  1656. if (desc.length > 0) {
  1657. desc += ",\n";
  1658. }
  1659. desc += "4G网络维修说明:" + e;
  1660. if (this.formData.satelliteDesc && this.formData.satelliteDesc.length > 0) {
  1661. if (desc.length > 0) {
  1662. desc += ",\n";
  1663. }
  1664. desc += "北斗维修说明:" + this.formData.satelliteDesc;
  1665. }
  1666. this.formData.processDesc = desc;
  1667. },
  1668. satelliteRemarkInput(e) {
  1669. let desc = "";
  1670. if (this.formData.rtuDesc && this.formData.rtuDesc.length > 0) {
  1671. desc += "RTU设备维修说明:" + this.formData.rtuDesc;
  1672. }
  1673. if (this.formData.rainSensorDesc && this.formData.rainSensorDesc.length > 0) {
  1674. if (desc.length > 0) {
  1675. desc += ",\n";
  1676. }
  1677. desc += "雨量传感器维修说明:" + this.formData.rainSensorDesc;
  1678. }
  1679. if (this.formData.waterSensorDesc && this.formData.waterSensorDesc.length > 0) {
  1680. if (desc.length > 0) {
  1681. desc += ",\n";
  1682. }
  1683. desc += "水位传感器维修说明:" + this.formData.waterSensorDesc;
  1684. }
  1685. if (this.formData.groundSensorDesc && this.formData.groundSensorDesc.length > 0) {
  1686. if (desc.length > 0) {
  1687. desc += ",\n";
  1688. }
  1689. desc += "墒情传感器维修说明:" + this.formData.groundSensorDesc;
  1690. }
  1691. if (this.formData.powerDesc && this.formData.powerDesc.length > 0) {
  1692. if (desc.length > 0) {
  1693. desc += ",\n";
  1694. }
  1695. desc += "供电维修说明:" + this.formData.powerDesc;
  1696. }
  1697. if (this.formData.networkDesc && this.formData.networkDesc.length > 0) {
  1698. if (desc.length > 0) {
  1699. desc += ",\n";
  1700. }
  1701. desc += "4G网络维修说明:" + this.formData.networkDesc;
  1702. }
  1703. if (desc.length > 0) {
  1704. desc += ",\n";
  1705. }
  1706. desc += "北斗维修说明:" + e;
  1707. this.formData.processDesc = desc;
  1708. },
  1709. onBaseBeforePhoto1DeleteClick() {
  1710. this.baseInfo.beforePhoto1Take = false;
  1711. },
  1712. onBaseBeforePhoto2DeleteClick() {
  1713. this.baseInfo.beforePhoto2Take = false;
  1714. },
  1715. onBaseAfterPhoto1DeleteClick() {
  1716. this.baseInfo.afterPhoto1Take = false;
  1717. },
  1718. onBaseAfterPhoto2DeleteClick() {
  1719. this.baseInfo.afterPhoto2Take = false;
  1720. },
  1721. onRtuPhotoDeleteClick() {
  1722. this.rtuInfo.photoTake = false;
  1723. },
  1724. onRainPhotoDeleteClick() {
  1725. this.rainSensorInfo.photoTake = false;
  1726. },
  1727. onWaterPhotoDeleteClick() {
  1728. this.waterSensorInfo.photoTake = false;
  1729. },
  1730. onGroundPhotoDeleteClick() {
  1731. this.groundSensorInfo.photoTake = false;
  1732. },
  1733. onBatteryPhotoDeleteClick() {
  1734. this.powerInfo.batteryPhotoTake = false;
  1735. },
  1736. onSunPowerPhotoDeleteClick() {
  1737. this.powerInfo.sunPhotoTake = false;
  1738. },
  1739. uploadPhotoCallback(path, photoIndex) {
  1740. if (photoIndex === 'baseBeforePhoto1') {
  1741. this.baseInfo.beforePhoto1Url = path;
  1742. this.baseInfo.beforePhoto1Take = true;
  1743. } else if (photoIndex === 'baseBeforePhoto2') {
  1744. this.baseInfo.beforePhoto2Url = path;
  1745. this.baseInfo.beforePhoto2Take = true;
  1746. } else if (photoIndex === 'baseAfterPhoto1') {
  1747. this.baseInfo.afterPhoto1Url = path;
  1748. this.baseInfo.afterPhoto1Take = true;
  1749. } else if (photoIndex === 'baseAfterPhoto2') {
  1750. this.baseInfo.afterPhoto2Url = path;
  1751. this.baseInfo.afterPhoto2Take = true;
  1752. } else if (photoIndex === 'rtu') {
  1753. this.rtuInfo.photoUrl = path;
  1754. this.rtuInfo.photoTake = true;
  1755. } else if (photoIndex === 'rain') {
  1756. this.rainSensorInfo.photoUrl = path;
  1757. this.rainSensorInfo.photoTake = true;
  1758. } else if (photoIndex === 'water') {
  1759. this.waterSensorInfo.photoUrl = path;
  1760. this.waterSensorInfo.photoTake = true;
  1761. } else if (photoIndex === 'ground') {
  1762. this.groundSensorInfo.photoUrl = path;
  1763. this.groundSensorInfo.photoTake = true;
  1764. } else if (photoIndex === 'battery') {
  1765. this.powerInfo.batteryPhotoUrl = path;
  1766. this.powerInfo.batteryPhotoTake = true;
  1767. } else if (photoIndex === 'sun') {
  1768. this.powerInfo.sunPhotoUrl = path;
  1769. this.powerInfo.sunPhotoTake = true;
  1770. }
  1771. },
  1772. uploadPhoto(imagePath, photoIndex) {
  1773. var that = this;
  1774. console.log("accessToken:" + uni.getStorageSync('accessToken'));
  1775. console.log("path " + imagePath);
  1776. uni.showLoading({
  1777. title: '上传中'
  1778. });
  1779. uni.uploadFile({
  1780. url: this.baseURL +
  1781. '/galaxy-resource/oss/endpoint/put-file-attach?Blade-Auth=' +
  1782. uni.getStorageSync('accessToken'),
  1783. fileType: 'image',
  1784. filePath: imagePath,
  1785. name: 'file',
  1786. success: (uploadFileRes) => {
  1787. uni.hideLoading()
  1788. if (uploadFileRes.statusCode == 200) {
  1789. let data = JSON.parse(uploadFileRes.data);
  1790. if (data.success) {
  1791. let path = data.data['name'];
  1792. console.log("paht " + path);
  1793. that.uploadPhotoCallback(path, photoIndex);
  1794. }
  1795. }
  1796. },
  1797. fail: (err) => {
  1798. uni.hideLoading()
  1799. console.log(err);
  1800. reject('err')
  1801. },
  1802. complete() {
  1803. uni.hideLoading()
  1804. }
  1805. });
  1806. },
  1807. getBaseBeforePhoto1() {
  1808. var that = this;
  1809. uni.chooseImage({
  1810. sourceType: ['camera'],
  1811. sizeType: ['compressed'],
  1812. success: (res) => {
  1813. const len = res.tempFilePaths.length;
  1814. if (len === 1) {
  1815. res.tempFilePaths.forEach(path => {
  1816. that.uploadPhoto(path, 'baseBeforePhoto1');
  1817. })
  1818. } else {
  1819. uni.showModal({
  1820. content: '只能选择一张图片,请确认!',
  1821. showCancel: false
  1822. });
  1823. }
  1824. }
  1825. })
  1826. },
  1827. getBaseBeforePhoto2() {
  1828. var that = this;
  1829. uni.chooseImage({
  1830. sourceType: ['camera'],
  1831. sizeType: ['compressed'],
  1832. success: (res) => {
  1833. const len = res.tempFilePaths.length;
  1834. if (len === 1) {
  1835. res.tempFilePaths.forEach(path => {
  1836. that.uploadPhoto(path, 'baseBeforePhoto2');
  1837. })
  1838. } else {
  1839. uni.showModal({
  1840. content: '只能选择一张图片,请确认!',
  1841. showCancel: false
  1842. });
  1843. }
  1844. }
  1845. })
  1846. },
  1847. getBaseAfterPhoto1() {
  1848. var that = this;
  1849. uni.chooseImage({
  1850. sourceType: ['camera'],
  1851. sizeType: ['compressed'],
  1852. success: (res) => {
  1853. const len = res.tempFilePaths.length;
  1854. if (len === 1) {
  1855. res.tempFilePaths.forEach(path => {
  1856. that.uploadPhoto(path, 'baseAfterPhoto1');
  1857. })
  1858. } else {
  1859. uni.showModal({
  1860. content: '只能选择一张图片,请确认!',
  1861. showCancel: false
  1862. });
  1863. }
  1864. }
  1865. })
  1866. },
  1867. getBaseAfterPhoto2() {
  1868. var that = this;
  1869. uni.chooseImage({
  1870. sourceType: ['camera'],
  1871. sizeType: ['compressed'],
  1872. success: (res) => {
  1873. const len = res.tempFilePaths.length;
  1874. if (len === 1) {
  1875. res.tempFilePaths.forEach(path => {
  1876. that.uploadPhoto(path, 'baseAfterPhoto2');
  1877. })
  1878. } else {
  1879. uni.showModal({
  1880. content: '只能选择一张图片,请确认!',
  1881. showCancel: false
  1882. });
  1883. }
  1884. }
  1885. })
  1886. },
  1887. getRtuPhoto() {
  1888. var that = this;
  1889. uni.chooseImage({
  1890. sourceType: ['camera'],
  1891. sizeType: ['compressed'],
  1892. success: (res) => {
  1893. const len = res.tempFilePaths.length;
  1894. if (len === 1) {
  1895. res.tempFilePaths.forEach(path => {
  1896. that.uploadPhoto(path, 'rtu');
  1897. })
  1898. } else {
  1899. uni.showModal({
  1900. content: '只能选择一张图片,请确认!',
  1901. showCancel: false
  1902. });
  1903. }
  1904. }
  1905. })
  1906. },
  1907. getRainSensorPhoto() {
  1908. var that = this;
  1909. uni.chooseImage({
  1910. sourceType: ['camera'],
  1911. sizeType: ['compressed'],
  1912. success: (res) => {
  1913. const len = res.tempFilePaths.length;
  1914. if (len === 1) {
  1915. res.tempFilePaths.forEach(path => {
  1916. that.uploadPhoto(path, 'rain');
  1917. })
  1918. } else {
  1919. uni.showModal({
  1920. content: '只能选择一张图片,请确认!',
  1921. showCancel: false
  1922. });
  1923. }
  1924. }
  1925. })
  1926. },
  1927. getWaterSensorPhoto() {
  1928. var that = this;
  1929. uni.chooseImage({
  1930. sourceType: ['camera'],
  1931. sizeType: ['compressed'],
  1932. success: (res) => {
  1933. const len = res.tempFilePaths.length;
  1934. if (len === 1) {
  1935. res.tempFilePaths.forEach(path => {
  1936. that.uploadPhoto(path, 'water');
  1937. })
  1938. } else {
  1939. uni.showModal({
  1940. content: '只能选择一张图片,请确认!',
  1941. showCancel: false
  1942. });
  1943. }
  1944. }
  1945. })
  1946. },
  1947. getGroundSensorPhoto() {
  1948. var that = this;
  1949. uni.chooseImage({
  1950. sourceType: ['camera'],
  1951. sizeType: ['compressed'],
  1952. success: (res) => {
  1953. const len = res.tempFilePaths.length;
  1954. if (len === 1) {
  1955. res.tempFilePaths.forEach(path => {
  1956. that.uploadPhoto(path, 'ground');
  1957. })
  1958. } else {
  1959. uni.showModal({
  1960. content: '只能选择一张图片,请确认!',
  1961. showCancel: false
  1962. });
  1963. }
  1964. }
  1965. })
  1966. },
  1967. getBatteryPhoto() {
  1968. var that = this;
  1969. uni.chooseImage({
  1970. sourceType: ['camera'],
  1971. sizeType: ['compressed'],
  1972. success: (res) => {
  1973. const len = res.tempFilePaths.length;
  1974. if (len === 1) {
  1975. res.tempFilePaths.forEach(path => {
  1976. that.uploadPhoto(path, 'battery');
  1977. })
  1978. } else {
  1979. uni.showModal({
  1980. content: '只能选择一张图片,请确认!',
  1981. showCancel: false
  1982. });
  1983. }
  1984. }
  1985. })
  1986. },
  1987. getSunPowerPhoto() {
  1988. var that = this;
  1989. uni.chooseImage({
  1990. sourceType: ['camera'],
  1991. sizeType: ['compressed'],
  1992. success: (res) => {
  1993. const len = res.tempFilePaths.length;
  1994. if (len === 1) {
  1995. res.tempFilePaths.forEach(path => {
  1996. that.uploadPhoto(path, 'sun');
  1997. })
  1998. } else {
  1999. uni.showModal({
  2000. content: '只能选择一张图片,请确认!',
  2001. showCancel: false
  2002. });
  2003. }
  2004. }
  2005. })
  2006. },
  2007. formReset: function(e) {
  2008. console.log('清空数据')
  2009. },
  2010. }
  2011. }
  2012. </script>
  2013. <style>
  2014. /* page {
  2015. background-color: rgb(240, 242, 244);
  2016. } */
  2017. </style>
  2018. <style lang="scss" scoped>
  2019. .cell-hover-class {
  2020. background-color: rgb(235, 237, 238);
  2021. }
  2022. .view-flex-rs {
  2023. display: flex;
  2024. flex-direction: row;
  2025. justify-content: flex-start;
  2026. align-items: center;
  2027. }
  2028. .view-flex-rc {
  2029. display: flex;
  2030. flex-direction: row;
  2031. justify-content: center;
  2032. align-items: center;
  2033. }
  2034. .view-flex-re {
  2035. display: flex;
  2036. flex-direction: row;
  2037. justify-content: flex-end;
  2038. align-items: center;
  2039. }
  2040. .view-flex-cs {
  2041. display: flex;
  2042. flex-direction: column;
  2043. justify-content: flex-start;
  2044. }
  2045. .view-flex-cc {
  2046. display: flex;
  2047. flex-direction: column;
  2048. justify-content: center;
  2049. }
  2050. .view-flex-ce {
  2051. display: flex;
  2052. flex-direction: column;
  2053. justify-content: flex-end;
  2054. }
  2055. .line-body {
  2056. padding-left: 10px;
  2057. padding-right: 10px;
  2058. }
  2059. .required-star {
  2060. color: #FF0000;
  2061. font-size: 15px;
  2062. width: 20px;
  2063. text-align: center;
  2064. padding-left: 0px;
  2065. padding-right: 2px;
  2066. }
  2067. .item-title {
  2068. color: #909399;
  2069. font-size: 15px;
  2070. }
  2071. .mline-text {
  2072. padding-left: 2px;
  2073. width: 100%;
  2074. /* background-color:#909399; */
  2075. height: 70px;
  2076. border: 1px solid #FF5A5F;
  2077. border-radius: 5px;
  2078. }
  2079. .footer {
  2080. position: fixed;
  2081. bottom: 0;
  2082. left: 0;
  2083. right: 0;
  2084. z-index: 1;
  2085. height: 100rpx;
  2086. padding: 20rpx;
  2087. box-sizing: border-box;
  2088. display: flex;
  2089. align-items: center;
  2090. justify-content: flex-end;
  2091. background-color: whitesmoke;
  2092. .ipt {
  2093. width: 380rpx;
  2094. height: 77rpx;
  2095. background: #f7f7f7;
  2096. border-radius: 38px;
  2097. padding: 0 37rpx;
  2098. box-sizing: border-box;
  2099. margin-right: 20rpx;
  2100. }
  2101. .control {
  2102. flex: 1;
  2103. display: flex;
  2104. align-items: center;
  2105. justify-content: flex-end;
  2106. .block {
  2107. display: flex;
  2108. align-items: center;
  2109. justify-content: center;
  2110. flex: 1;
  2111. }
  2112. .icon {
  2113. height: auto;
  2114. }
  2115. .c {
  2116. width: 41rpx;
  2117. margin-right: 10rpx;
  2118. }
  2119. .s {
  2120. width: 36rpx;
  2121. }
  2122. .t {
  2123. width: 31rpx;
  2124. }
  2125. }
  2126. }
  2127. .container {
  2128. padding: 0 0 100rpx;
  2129. }
  2130. .img-container {
  2131. margin-bottom: 0px;
  2132. width: 80px;
  2133. height: 80px;
  2134. .note-image-box {
  2135. margin-top: 5px;
  2136. display: flex;
  2137. flex-wrap: wrap;
  2138. padding: 0px;
  2139. .note-image-item {
  2140. position: relative;
  2141. width: 100%;
  2142. height: 0;
  2143. padding-top: 100%;
  2144. box-sizing: border-box;
  2145. // background-color: #18B566;
  2146. .close-icon {
  2147. display: flex;
  2148. justify-content: center;
  2149. align-items: center;
  2150. position: absolute;
  2151. right: 0px;
  2152. top: 0px;
  2153. width: 22px;
  2154. height: 22px;
  2155. border-radius: 50%;
  2156. background-color: #d5d5d5;
  2157. z-index: 2;
  2158. }
  2159. .image-box {
  2160. display: flex;
  2161. justify-content: center;
  2162. align-items: center;
  2163. position: absolute;
  2164. top: 0px;
  2165. right: 0px;
  2166. border: 0px;
  2167. left: 0px;
  2168. border: 1px #eee solid;
  2169. border-radius: 5px;
  2170. overflow: hidden;
  2171. width: 98%;
  2172. height: 98%;
  2173. }
  2174. }
  2175. }
  2176. }
  2177. .input-body {
  2178. background-color: #fff;
  2179. padding: 10px;
  2180. }
  2181. .mb-10 {
  2182. margin-top: 0px;
  2183. margin-bottom: 0px;
  2184. }
  2185. .decoration {
  2186. width: 6px;
  2187. height: 6px;
  2188. margin-right: 4px;
  2189. border-radius: 50%;
  2190. background-color: cadetblue;
  2191. }
  2192. </style>