historyDetailsCourtyard.vue 33 KB

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