historyDetailsEnginproject.vue 34 KB

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