historyDetailMunicipal.vue 33 KB

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