historyDetailsCourtyard.vue 33 KB

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