historyDetailsCourtyard.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031
  1. <template>
  2. <view>
  3. <view class="uni-media-list">
  4. <view class="uni-media-list-body">
  5. <view v-for="(value, key) in dataJson.zEngineeringNodeBo.zEngineeringInfoBoList" :key="key"
  6. v-if="isEdit(value)">
  7. <view class="uni-media-list-text-top">
  8. <view class="tit-text">施工时间:</view>{{value.updateTime}}
  9. </view>
  10. <view class="uni-common-mt" style="width: 100%;">
  11. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  12. #000;margin-top: 5px;">施工内容:</text>
  13. <view style="width: 100%;padding-right: 20rpx;box-sizing: border-box;">
  14. <textarea class="textarea" maxlength="255" placeholder-style="padding: 10rpx;"
  15. style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal; min-height: 30px;"
  16. auto-height :value="value.remark"
  17. @blur="bindTextAreaBlur($event.target.value,key)"></textarea>
  18. </view>
  19. </view>
  20. <view v-if="title=='开挖前'||title=='开挖后'||title=='焊口照片'||title=='隐蔽工程'">
  21. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  22. <image :src="loadImgSrc('updateimg.png')" mode=""
  23. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('ohter',key)">
  24. </image>
  25. <view v-for="(item,index) in value.zEngiineeringPhotoBoList" :key="index"
  26. style="position: relative;">
  27. <view
  28. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  29. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  30. @click="showPhoto(index,value.zEngiineeringPhotoBoList)">
  31. </image>
  32. </view>
  33. <view v-else>
  34. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  35. </view>
  36. <view @click="remove(index,key)"
  37. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  38. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  39. </image>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view v-if="title=='回填'">
  45. <view class="uni-common-mt" style="width: 100%;">
  46. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  47. #000;margin-top: 5px; margin-left: 8px;">石粉回填照片:</text>
  48. </view>
  49. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  50. <image :src="loadImgSrc('updateimg.png')" mode=""
  51. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('sfht',key)">
  52. </image>
  53. <view v-for="(item,index) in value.stonePowder" :key="index" style="position: relative;">
  54. <view
  55. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  56. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  57. @click="showPhoto(index,value.stonePowder)">
  58. </image>
  59. </view>
  60. <view v-else>
  61. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  62. </view>
  63. <view @click="removeht(index,key,'sfht')"
  64. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  65. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  66. </image>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="uni-common-mt" style="width: 100%;">
  71. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  72. #000;margin-top: 5px;margin-left: 8px;">警示带铺设照片:</text>
  73. </view>
  74. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  75. <image :src="loadImgSrc('updateimg.png')" mode=""
  76. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('jsdps',key)">
  77. </image>
  78. <view v-for="(item,index) in value.warningtTape" :key="index" style="position: relative;">
  79. <view
  80. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  81. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  82. @click="showPhoto(index,value.warningtTape)">
  83. </image>
  84. </view>
  85. <view v-else>
  86. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  87. </view>
  88. <view @click="removeht(index,key,'jsdps')"
  89. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  90. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  91. </image>
  92. </view>
  93. </view>
  94. </view>
  95. <view class="uni-common-mt" style="width: 100%;">
  96. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  97. #000;margin-top: 5px;margin-left: 8px;">回填后照片:</text>
  98. </view>
  99. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  100. <image :src="loadImgSrc('updateimg.png')" mode=""
  101. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('hth',key)">
  102. </image>
  103. <view v-for="(item,index) in value.photosAfter" :key="index" style="position: relative;">
  104. <view
  105. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  106. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  107. @click="showPhoto(index,value.photosAfter)">
  108. </image>
  109. </view>
  110. <view v-else>
  111. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  112. </view>
  113. <view @click="removeht(index,key,'hth')"
  114. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  115. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  116. </image>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <view v-if="title=='下沟'">
  122. <view class="cz-style" v-for="(a,index) in value.zEngineeringMaterialBo" :key="index">
  123. <view class="uni-media-list-text-top" style=" ">
  124. <view class="tit-text">材质:</view>
  125. <view class="uni-list-cell-db" style="margin-top: 10;"
  126. @click="pickerShow('cz',key,index)">
  127. <span
  128. style="color: black;">{{a.materialQualityName==''?'请选择材质':a.materialQualityName}}</span>
  129. </view>
  130. </view>
  131. <view class="uni-media-list-text-top" style=" ">
  132. <view class="tit-text">规格:</view>
  133. <view class="uni-list-cell-db" style="margin-top: 10;"
  134. @click="pickerShow('gg',key,index)">
  135. <span
  136. style="color: black;">{{a.specificationsName==''?'请选择规格':a.specificationsName}}</span>
  137. </view>
  138. </view>
  139. <view class="uni-media-list-text-top" style="border-bottom: 1px solid #f8f8f8;">
  140. <text class="tit-text">米 数</text>
  141. <view style="display: flex; justify-content: right; width: 70%;">
  142. <input class="uni-input" type="number" :value="getIntegerPart(a.number,0)"
  143. @change="setInfoBoNumber(key,index,$event.target.value,0)" maxlength="6"
  144. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  145. <text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
  146. <input class="uni-input" type="number" :value="getIntegerPart(a.number,1)"
  147. @change="setInfoBoNumber(key,index,$event.target.value,1)" maxlength="1"
  148. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  149. </view>
  150. </view>
  151. <button v-if="index!=0" @click="btnDel(key,index)" class="sc-btn">删除</button>
  152. </view>
  153. <button @click="btnAdd(key,index)" class="tj-btn">添加</button>
  154. <view class="uni-common-mt" style="width: 100%;">
  155. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  156. #000;margin-top: 5px; margin-left: 8px;">管道施工记录:</text>
  157. </view>
  158. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  159. <image :src="loadImgSrc('updateimg.png')" mode=""
  160. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; "
  161. @click="chooseType('gdsgjl',key)">
  162. </image>
  163. <view v-for="(item,index) in value.constructionRecords" :key="index"
  164. style="position: relative;">
  165. <view
  166. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  167. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  168. @click="showPhoto(index,value.constructionRecords)">
  169. </image>
  170. </view>
  171. <view v-else>
  172. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  173. </view>
  174. <view @click="removeht(index,key,'gdsgjl')"
  175. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  176. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  177. </image>
  178. </view>
  179. </view>
  180. </view>
  181. <view class="uni-common-mt" style="width: 100%;">
  182. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  183. #000;margin-top: 5px; margin-left: 8px;">管上皮深度测量照片:</text>
  184. </view>
  185. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  186. <image :src="loadImgSrc('updateimg.png')" mode=""
  187. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; "
  188. @click="chooseType('gspsdcl',key)">
  189. </image>
  190. <view v-for="(item,index) in value.ductalEpithelium" :key="index"
  191. style="position: relative;">
  192. <view
  193. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  194. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  195. @click="showPhoto(index,value.ductalEpithelium)">
  196. </image>
  197. </view>
  198. <view v-else>
  199. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  200. </view>
  201. <view @click="removeht(index,key,'gspsdcl')"
  202. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  203. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  204. </image>
  205. </view>
  206. </view>
  207. </view>
  208. <view class="uni-common-mt" style="width: 100%;">
  209. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  210. #000;margin-top: 5px;margin-left: 8px;">管沟远景照片:</text>
  211. </view>
  212. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  213. <image :src="loadImgSrc('updateimg.png')" mode=""
  214. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; "
  215. @click="chooseType('ggyj',key)">
  216. </image>
  217. <view v-for="(item,index) in value.trenchProspect" :key="index" style="position: relative;">
  218. <view
  219. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  220. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  221. @click="showPhoto(index,value.trenchProspect)">
  222. </image>
  223. </view>
  224. <view v-else>
  225. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  226. </view>
  227. <view @click="removeht(index,key,'ggyj')"
  228. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  229. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  230. </image>
  231. </view>
  232. </view>
  233. </view>
  234. <view class="uni-common-mt" style="width: 100%;">
  235. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  236. #000;margin-top: 5px;margin-left: 8px;">视频:</text>
  237. </view>
  238. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  239. <image :src="loadImgSrc('updateimg.png')" mode=""
  240. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; "
  241. @click="chooseType('video',key)">
  242. </image>
  243. <view v-for="(item,index) in value.video" :key="index" style="position: relative;">
  244. <view>
  245. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  246. </view>
  247. <view @click="removeht(index,key,'video')"
  248. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  249. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  250. </image>
  251. </view>
  252. </view>
  253. </view>
  254. </view>
  255. </view>
  256. </view>
  257. </view>
  258. <!-- <view class="gesture-area" v-show="playVideo" >
  259. <view @click="closeVideo()"
  260. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  261. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  262. </image>
  263. </view>
  264. <video :src="playVideoSrc"></video>
  265. </view> -->
  266. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  267. subtitleKey="id">
  268. </SelectPicker>
  269. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  270. titleKey="dictLabel" subtitleKey="dictValue" v-model="name"></SelectPicker>
  271. <view class="action-btn" v-if="hideButton==false">
  272. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认</button>
  273. </view>
  274. </view>
  275. </template>
  276. <script>
  277. import SelectPicker from '../../components/selectPicker/select_picker.vue'
  278. import {
  279. getDicts
  280. } from "@/api/system/dict/data";
  281. import {
  282. getToken
  283. } from '../../utils/auth';
  284. import user from '@/store/modules/user'
  285. import {
  286. getHistoryDetails,
  287. getEnginMaterialQualityList,
  288. putHistory,
  289. getEnginSpecificationsList
  290. } from '@/api/common'
  291. export default {
  292. components: {
  293. SelectPicker,
  294. },
  295. data() {
  296. return {
  297. // playVideo: false,//视频播放放大
  298. // playVideoSrc:'',
  299. selectZbfList: [],
  300. dictOptions: [],
  301. openDict: false,
  302. dataIndex: 0, //数据用第几条
  303. selectIndex: 0, //材质规格用的第几条
  304. imageIndex: 0,
  305. headers: {
  306. Authorization: "Bearer " + getToken()
  307. },
  308. nodeId: '',
  309. type: '',
  310. title: '',
  311. dataJson: '',
  312. enginClassification: '',
  313. enginType: '',
  314. enginClassValue: '',
  315. selectList: [],
  316. open: false,
  317. selectType: '',
  318. hideButton: false,
  319. }
  320. },
  321. onLoad(options) {
  322. if ('params' in options) {
  323. let e = JSON.parse(decodeURIComponent(options.params));
  324. this.nodeId = e.id;
  325. this.type = e.type;
  326. getHistoryDetails(this.nodeId, this.type).then(response => {
  327. if (response.data.zEngineeringNodeBo != null) {
  328. this.hideButton = false;
  329. this.dataJson = response.data;
  330. this.title = response.data.zEngineeringNodeBo.type;
  331. this.enginType = response.data.enginType;
  332. this.enginClassification = response.data.enginClassification;
  333. } else {
  334. this.hideButton = true;
  335. this.$modal.msg("暂无历史信息")
  336. }
  337. });
  338. }
  339. },
  340. methods: {
  341. //关闭弹窗
  342. close(e) {
  343. this.open = false
  344. },
  345. btnAdd(key, index) {
  346. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].zEngineeringMaterialBo.push({
  347. 'materialQuality': '',
  348. 'materialQualityName': '',
  349. 'number': '',
  350. 'specifications': '',
  351. 'specificationsName': ''
  352. });
  353. },
  354. btnDel(key, index) {
  355. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].zEngineeringMaterialBo.splice(index, 1);
  356. },
  357. pickerShow(e, index, indexTwo) {
  358. this.dataIndex = index;
  359. this.selectIndex = indexTwo; //材质规格 第几条
  360. this.selectType = e;
  361. if (e == 'cz') {
  362. this.open = true;
  363. getEnginMaterialQualityList("民用工程", this.enginType, this.enginClassification, this.title)
  364. .then(response => {
  365. this.selectList = response.data;
  366. });
  367. }
  368. if (e == 'gg') {
  369. if (this.isEmpty(this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex]
  370. .zEngineeringMaterialBo[this.selectIndex].materialQuality)) {
  371. this.$modal.msg('请选择材质')
  372. } else {
  373. this.open = true;
  374. getEnginSpecificationsList(this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex]
  375. .zEngineeringMaterialBo[this.selectIndex].materialQuality).then(res => {
  376. this.selectList = res.data
  377. })
  378. }
  379. }
  380. },
  381. changeSelect(item, index) {
  382. this.open = false;
  383. if (this.selectType == 'cz') {
  384. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[this
  385. .selectIndex]
  386. .materialQuality = item.id;
  387. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[this
  388. .selectIndex]
  389. .materialQualityName = item.name;
  390. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[this
  391. .selectIndex]
  392. .specifications = '';
  393. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[this
  394. .selectIndex]
  395. .specificationsName = '';
  396. } else if (this.selectType == 'gg') {
  397. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[this
  398. .selectIndex]
  399. .specifications = item.id;
  400. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[this.dataIndex].zEngineeringMaterialBo[this
  401. .selectIndex]
  402. .specificationsName = item.name;
  403. }
  404. },
  405. // 截取小数点前的字符串
  406. getIntegerPart(numStr, i) {
  407. return numStr.toString().split('.')[i] == undefined ? '0' : numStr.toString().split('.')[i];
  408. },
  409. setInfoBoNumber(key, index, number, i) {
  410. let Ynumber = this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].zEngineeringMaterialBo[index]
  411. .number;
  412. let resAry = Ynumber.toString().split('.');
  413. resAry[i] = number
  414. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].zEngineeringMaterialBo[index].number = resAry
  415. .join('.');
  416. },
  417. bindTextAreaBlur(e, index) {
  418. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[index].remark = e;
  419. },
  420. removeht(index, key, type) {
  421. uni.showModal({
  422. title: '提示',
  423. content: '是否删除该图片或视频?',
  424. success: (res) => {
  425. if (res.confirm) {
  426. if (type == 'sfht') {
  427. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].stonePowder
  428. .splice(index, 1)
  429. } else if (type == 'jsdps') {
  430. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].warningtTape
  431. .splice(index, 1)
  432. } else if (type == 'hth') {
  433. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].photosAfter
  434. .splice(index, 1)
  435. } else if (type == 'gdsgjl') {
  436. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key]
  437. .constructionRecords
  438. .splice(index, 1)
  439. } else if (type == 'gspsdcl') {
  440. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key]
  441. .ductalEpithelium
  442. .splice(index, 1)
  443. } else if (type == 'ggyj') {
  444. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key]
  445. .trenchProspect
  446. .splice(index, 1)
  447. } else if (type == 'video') {
  448. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key]
  449. .video
  450. .splice(index, 1)
  451. }
  452. }
  453. }
  454. })
  455. },
  456. remove(index, key) {
  457. uni.showModal({
  458. title: '提示',
  459. content: '是否删除该图片或视频?',
  460. success: (res) => {
  461. if (res.confirm) {
  462. this.dataJson.zEngineeringNodeBo
  463. .zEngineeringInfoBoList[key]
  464. .zEngiineeringPhotoBoList.splice(index, 1)
  465. }
  466. }
  467. })
  468. },
  469. chooseType(type, index) {
  470. this.dataIndex = index;
  471. let _this = this;
  472. if (type == 'video') {
  473. this.choosevideo(type)
  474. } else {
  475. this.chooseimage(type)
  476. }
  477. },
  478. choose(type, index) {
  479. this.dataIndex = index;
  480. let _this = this;
  481. uni.showActionSheet({
  482. title: '上传',
  483. itemList: ['图片', '视频'],
  484. success: (res) => {
  485. if (res.tapIndex == 0) {
  486. this.chooseimage(type)
  487. } else {
  488. this.choosevideo(type)
  489. }
  490. }
  491. })
  492. },
  493. chooseimage(e) {
  494. let _this = this;
  495. uni.chooseImage({
  496. sizeType: ['album', 'camera'],
  497. success(resp) {
  498. resp.tempFiles.forEach((item, index) => {
  499. const task = uni.uploadFile({
  500. url: _this.$HTTP + `/obs`,
  501. filePath: item.path,
  502. name: 'file',
  503. formData: {},
  504. header: _this.headers,
  505. success: res => {
  506. let data = JSON.parse(res.data);
  507. if (![200].includes(data.code)) {
  508. _this.$modal.msg(data.msg)
  509. } else {
  510. if (_this.progress === 100) {
  511. if (e == 'other') {
  512. _this.dataJson.zEngineeringNodeBo
  513. .zEngineeringInfoBoList[_this.dataIndex]
  514. .zEngiineeringPhotoBoList.push(data.data
  515. .url);
  516. } else if (e == 'sfht') {
  517. _this.dataJson.zEngineeringNodeBo
  518. .zEngineeringInfoBoList[_this.dataIndex]
  519. .stonePowder.push(data.data
  520. .url);
  521. } else if (e == 'jsdps') {
  522. _this.dataJson.zEngineeringNodeBo
  523. .zEngineeringInfoBoList[_this.dataIndex]
  524. .warningtTape.push(data.data
  525. .url);
  526. } else if (e == 'hth') {
  527. _this.dataJson.zEngineeringNodeBo
  528. .zEngineeringInfoBoList[_this.dataIndex]
  529. .photosAfter.push(data.data
  530. .url);
  531. } else if (e == 'gdsgjl') {
  532. _this.dataJson.zEngineeringNodeBo
  533. .zEngineeringInfoBoList[_this.dataIndex]
  534. .constructionRecords.push(data.data
  535. .url);
  536. } else if (e == 'gspsdcl') {
  537. _this.dataJson.zEngineeringNodeBo
  538. .zEngineeringInfoBoList[_this.dataIndex]
  539. .ductalEpithelium.push(data.data
  540. .url);
  541. } else if (e == 'ggyj') {
  542. _this.dataJson.zEngineeringNodeBo
  543. .zEngineeringInfoBoList[_this.dataIndex]
  544. .trenchProspect.push(data.data
  545. .url);
  546. }
  547. _this.$modal.msg('上传成功!')
  548. }
  549. }
  550. },
  551. fail: e => {
  552. _this.$modal.msg('上传失败!')
  553. },
  554. complete: res => {
  555. uni.hideLoading();
  556. _this.uploading = false;
  557. }
  558. });
  559. task.onProgressUpdate(res => {
  560. _this.progress = res.progress;
  561. uni.showLoading({
  562. title: '上传中'
  563. })
  564. if (_this.progress != 100) {
  565. _this.loading = false
  566. } else {
  567. _this.loading = true
  568. }
  569. });
  570. })
  571. },
  572. })
  573. },
  574. choosevideo(e) {
  575. let _this = this;
  576. uni.chooseVideo({
  577. sourceType: ['album', 'camera'],
  578. maxDuration: 30,
  579. success(resp) {
  580. const task = uni.uploadFile({
  581. url: _this.$HTTP + `/obs`,
  582. filePath: resp.tempFilePath,
  583. name: 'file',
  584. formData: {},
  585. header: _this.headers,
  586. success: res => {
  587. let data = JSON.parse(res.data);
  588. if (![200].includes(res.statusCode)) {
  589. this.uploadError(index, data);
  590. } else {
  591. //上传成功
  592. if (_this.progress === 100) {
  593. if (e == 'other') {
  594. _this.dataJson.zEngineeringNodeBo
  595. .zEngineeringInfoBoList[_this.dataIndex]
  596. .zEngiineeringPhotoBoList.push(data.data.url);
  597. } else if (e == 'sfht') {
  598. _this.dataJson.zEngineeringNodeBo
  599. .zEngineeringInfoBoList[_this.dataIndex]
  600. .stonePowder.push(data.data.url);
  601. } else if (e == 'jsdps') {
  602. _this.dataJson.zEngineeringNodeBo
  603. .zEngineeringInfoBoList[_this.dataIndex]
  604. .warningtTape.push(data.data.url);
  605. } else if (e == 'hth') {
  606. _this.dataJson.zEngineeringNodeBo
  607. .zEngineeringInfoBoList[_this.dataIndex]
  608. .photosAfter.push(data.data.url);
  609. } else if (e == 'video') {
  610. _this.dataJson.zEngineeringNodeBo
  611. .zEngineeringInfoBoList[_this.dataIndex]
  612. .video.push(data.data.url);
  613. }
  614. _this.$modal.msg('上传成功!')
  615. }
  616. }
  617. },
  618. fail: e => {
  619. _this.$modal.msg('上传失败!')
  620. this.uploadError(index, e);
  621. },
  622. complete: res => {
  623. uni.hideLoading();
  624. _this.uploading = false;
  625. }
  626. });
  627. task.onProgressUpdate(res => {
  628. _this.progress = res.progress;
  629. uni.showLoading({
  630. title: '上传中'
  631. })
  632. if (_this.progress != 100) {
  633. _this.loading = false
  634. } else {
  635. _this.loading = true
  636. }
  637. });
  638. },
  639. })
  640. },
  641. showPhoto(index, arr) {
  642. let newArr = [];
  643. arr.forEach((item, index) => {
  644. if (item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ||
  645. item.substring(item.length - 4) == 'jpeg') {
  646. newArr.push(item)
  647. }
  648. });
  649. uni.previewImage({
  650. current: index,
  651. urls: newArr,
  652. })
  653. },
  654. // showVideo(arr) {
  655. // this.playVideo = true;
  656. // this.playVideoSrc = arr;
  657. // },
  658. // closeVideo(){
  659. // this.playVideo = false;
  660. // },
  661. isEmpty(str) {
  662. return (!str || 0 === str.length);
  663. },
  664. isEdit(item) {
  665. var isShow = item.createBy == this.$user.state.name;
  666. return isShow;
  667. },
  668. submit() {
  669. let isSubmit = true;
  670. if (this.title == '回填') {
  671. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList.forEach((res) => {
  672. if (res.stonePowder.length == 0) {
  673. this.$modal.msg("请上传石粉回填照片");
  674. isSubmit = false;
  675. }
  676. if (res.warningtTape.length == 0) {
  677. this.$modal.msg("请上传警示带铺设照片");
  678. isSubmit = false;
  679. }
  680. if (res.photosAfter.length == 0) {
  681. this.$modal.msg("请上传回填后照片");
  682. isSubmit = false;
  683. }
  684. })
  685. } else if (this.title == '下沟') {
  686. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList.forEach((res) => {
  687. res.zEngineeringMaterialBo.forEach((itme) => {
  688. if (itme.specifications == '') {
  689. this.$modal.msg("请选择规格");
  690. isSubmit = false;
  691. }
  692. if (itme.number == '') {
  693. this.$modal.msg("请输入米数");
  694. isSubmit = false;
  695. }
  696. })
  697. if (res.constructionRecords.length <= 0) {
  698. this.$modal.msg('请上传管道施工记录照片')
  699. isSubmit = false;
  700. }
  701. if (res.ductalEpithelium.length <= 0) {
  702. this.$modal.msg('请上传管上皮深度测量照片')
  703. isSubmit = false;
  704. }
  705. if (res.trenchProspect.length <= 0) {
  706. this.$modal.msg('请上传管沟远景照片')
  707. isSubmit = false;
  708. }
  709. if (res.video.length <= 0) {
  710. this.$modal.msg('请上传视频')
  711. isSubmit = false;
  712. }
  713. })
  714. } else {
  715. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList.forEach((res) => {
  716. if (res.zEngiineeringPhotoBoList.length == 0) {
  717. this.$modal.msg("请上传照片");
  718. isSubmit = false;
  719. }
  720. })
  721. }
  722. if (!isSubmit) {
  723. return
  724. }
  725. putHistory(this.dataJson).then(
  726. response => {
  727. if (response.code == '200') {
  728. uni.hideLoading()
  729. uni.showToast({
  730. title: response.msg,
  731. icon: 'none',
  732. duration: 2000
  733. });
  734. setTimeout(function() {
  735. uni.navigateBack();
  736. }, 1000)
  737. }
  738. });
  739. }
  740. }
  741. }
  742. </script>
  743. <style lang="scss">
  744. .uni-media-list-body {
  745. background: #fff;
  746. border: 1px solid #eee;
  747. border-radius: 40rpx;
  748. margin: 20rpx;
  749. padding: 10rpx 0 40rpx;
  750. box-shadow: 0 0 5px #eee;
  751. }
  752. .uni-media-list-text-top {
  753. display: flex;
  754. align-items: center;
  755. justify-content: space-between;
  756. padding: 10px;
  757. position: relative;
  758. }
  759. .to-right-icon {
  760. width: 15px;
  761. height: 15px;
  762. position: absolute;
  763. top: 50%;
  764. transform: translateY(-50%);
  765. }
  766. .share {
  767. width: 100%;
  768. height: 100%;
  769. }
  770. .tit-text {
  771. color: #4f535a;
  772. margin-right: 20rpx;
  773. }
  774. .normal-text {}
  775. .cz-style {
  776. background: #e8f4f9;
  777. margin: 20rpx;
  778. padding: 10rpx;
  779. border-radius: 20rpx;
  780. border: 1px solid #d4e3f0;
  781. }
  782. .uni-media-list-text-top {
  783. font-size: 14px;
  784. color: #696969;
  785. padding: 20rpx 20rpx;
  786. border-bottom: 1px solid #eee;
  787. display: flex;
  788. align-items: center;
  789. }
  790. .share-box {
  791. width: 100%;
  792. height: 100%;
  793. position: fixed;
  794. top: 0rpx;
  795. left: 0rpx;
  796. bottom: 0rpx;
  797. right: 0rpx;
  798. background-color: rgba(0, 0, 0, 0.4);
  799. transition: .3s;
  800. z-index: 999;
  801. }
  802. // 进入分享动画
  803. .share-show {
  804. transition: all 0.3s ease;
  805. transform: translateY(0%) !important;
  806. border-radius: 20px 20px 0px 0px;
  807. }
  808. .scroll-Y {
  809. height: 58vh;
  810. }
  811. // 离开分享动画
  812. .share-item {
  813. position: fixed;
  814. left: 0;
  815. bottom: 0;
  816. width: 100%;
  817. height: 70%;
  818. background-color: #FFFFFF;
  819. transition: all 0.3s ease;
  820. transform: translateY(100%);
  821. z-index: 1999;
  822. .share-to {
  823. width: 100%;
  824. height: 30px;
  825. display: flex;
  826. justify-content: left;
  827. margin: 30rpx 35rpx;
  828. align-items: center;
  829. }
  830. .content {
  831. width: 100%;
  832. height: auto;
  833. display: flex;
  834. flex-wrap: wrap;
  835. .block {
  836. width: 100%;
  837. display: flex;
  838. flex-direction: column;
  839. justify-content: center;
  840. align-items: left;
  841. height: auto;
  842. image {
  843. width: 80rpx;
  844. height: 80rpx;
  845. }
  846. text {
  847. margin-top: 16rpx;
  848. font-size: 28rpx;
  849. color: #606266;
  850. }
  851. }
  852. }
  853. .cancel {
  854. width: 100%;
  855. height: 3rem;
  856. display: flex;
  857. justify-content: center;
  858. align-items: center;
  859. border-top: 1rpx solid #E4E7ED;
  860. }
  861. }
  862. .uni-media-list-text-top {
  863. display: flex;
  864. align-items: center;
  865. justify-content: space-between;
  866. padding: 10px;
  867. position: relative;
  868. }
  869. .uni-list {
  870. border: 1xp solid #eee;
  871. }
  872. .to-right-icon {
  873. width: 15px;
  874. height: 15px;
  875. position: absolute;
  876. top: 50%;
  877. transform: translateY(-50%);
  878. }
  879. .text {
  880. font-size: 16px;
  881. color: #333;
  882. }
  883. .tj-btn {
  884. height: 69rpx;
  885. background: #3184f0;
  886. border-radius: 6rpx;
  887. font-size: 25rpx;
  888. font-weight: 400;
  889. color: #FFFFFF;
  890. line-height: 69rpx;
  891. margin: 40rpx 70rpx;
  892. }
  893. .sc-btn {
  894. height: 69rpx;
  895. background: #f0686b;
  896. border-radius: 6rpx;
  897. font-size: 25rpx;
  898. font-weight: 400;
  899. color: #FFFFFF;
  900. line-height: 69rpx;
  901. margin: 40rpx;
  902. }
  903. // .gesture-area {
  904. // //加浮动弹窗
  905. // width: 100%;
  906. // height: 100%;
  907. // }
  908. </style>