historyDetailMunicipal.vue 33 KB

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