historyDetailsCourtyard.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092
  1. <template>
  2. <scroll-view>
  3. <view class="uni-media-list" v-for="(value, key) in dataJson.zEngineeringNodeBo.zEngineeringInfoBoList" :key="key"
  4. 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">施工时间222:</view>{{value.updateTime}}
  9. </view>
  10. <view class="uni-media-list-text-top">
  11. <view class="uni-common-mt" style="width: 100%;">
  12. <text class="tit-text" style=" font-size: 13px;color:
  13. #000;margin-top: 5px;">施工内容:</text>
  14. <view style="width: 100%;box-sizing: border-box;">
  15. <textarea class="textarea" maxlength="255" placeholder-style="padding: 10rpx;"
  16. style="width: 100%;height: 100%;border: 1rpx solid #cccccc; border-radius: 15rpx;padding: 10rpx;line-height:normal;"
  17. auto-height :value="value.remark"
  18. @blur="bindTextAreaBlur($event.target.value,key)"></textarea>
  19. </view>
  20. </view>
  21. </view>
  22. <view
  23. v-if="title=='开挖前'||title=='开挖后'||title=='焊口照片'||title=='隐蔽工程'||title=='除锈刷油'||title=='打磨'||title=='全貌照片'">
  24. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px; margin-left: 10px;">
  25. <image :src="loadImgSrc('updateimg.png')" mode=""
  26. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('other',key)">
  27. </image>
  28. <view v-for="(item,index) in value.zEngiineeringPhotoBoList" :key="index"
  29. style="position: relative;">
  30. <view
  31. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg'||item.substring(item.length-4)=='jpeg' ">
  32. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  33. @click="showPhoto(index,value.zEngiineeringPhotoBoList)">
  34. </image>
  35. </view>
  36. <view v-else>
  37. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  38. </view>
  39. <view @click="remove(index,key)"
  40. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  41. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  42. </image>
  43. </view>
  44. </view>
  45. </view>
  46. <view v-if="title=='全貌照片'">
  47. <view class="cz-style" v-for="(a,index) in value.zEngineeringMaterialBo" :key="index">
  48. <view class="uni-media-list-text-top" style=" ">
  49. <view class="tit-text">材质:</view>
  50. <view class="uni-list-cell-db" style="margin-top: 10;"
  51. @click="pickerShow('cz',key,index)">
  52. <span
  53. style="color: black;">{{a.materialQualityName==''?'请选择材质':a.materialQualityName}}</span>
  54. </view>
  55. </view>
  56. <view class="uni-media-list-text-top" style=" ">
  57. <view class="tit-text">规格:</view>
  58. <view class="uni-list-cell-db" style="margin-top: 10;"
  59. @click="pickerShow('gg',key,index)">
  60. <span
  61. style="color: black;">{{a.specificationsName==''?'请选择规格':a.specificationsName}}</span>
  62. </view>
  63. </view>
  64. <view class="uni-media-list-text-top" style="border-bottom: 1px solid #f8f8f8;">
  65. <text class="tit-text">米 数</text>
  66. <view style="display: flex; justify-content: right; width: 70%;">
  67. <input class="uni-input" type="number" :value="getIntegerPart(a.number,0)"
  68. @change="setInfoBoNumber(key,index,$event.target.value,0)" maxlength="6"
  69. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  70. <text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
  71. <input class="uni-input" type="number" :value="getIntegerPart(a.number,1)"
  72. @change="setInfoBoNumber(key,index,$event.target.value,1)" maxlength="1"
  73. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  74. </view>
  75. </view>
  76. <button v-if="index!=0" @click="btnDel(key,index)" class="sc-btn">删除</button>
  77. </view>
  78. <button @click="btnAdd(key,index)" class="tj-btn">添加</button>
  79. </view>
  80. </view>
  81. <view v-if="title=='回填'">
  82. <view class="uni-common-mt" style="width: 100%;">
  83. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  84. #000;margin-top: 5px; margin-left: 8px;">石粉回填照片:</text>
  85. </view>
  86. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  87. <image :src="loadImgSrc('updateimg.png')" mode=""
  88. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('sfht',key)">
  89. </image>
  90. <view v-for="(item,index) in value.stonePowder" :key="index" style="position: relative;">
  91. <view
  92. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  93. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  94. @click="showPhoto(index,value.stonePowder)">
  95. </image>
  96. </view>
  97. <view v-else>
  98. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  99. </view>
  100. <view @click="removeht(index,key,'sfht')"
  101. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  102. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  103. </image>
  104. </view>
  105. </view>
  106. </view>
  107. <view class="uni-common-mt" style="width: 100%;">
  108. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  109. #000;margin-top: 5px;margin-left: 8px;">警示带铺设照片:</text>
  110. </view>
  111. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  112. <image :src="loadImgSrc('updateimg.png')" mode=""
  113. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('jsdps',key)">
  114. </image>
  115. <view v-for="(item,index) in value.warningtTape" :key="index" style="position: relative;">
  116. <view
  117. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  118. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  119. @click="showPhoto(index,value.warningtTape)">
  120. </image>
  121. </view>
  122. <view v-else>
  123. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  124. </view>
  125. <view @click="removeht(index,key,'jsdps')"
  126. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  127. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  128. </image>
  129. </view>
  130. </view>
  131. </view>
  132. <view class="uni-common-mt" style="width: 100%;">
  133. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  134. #000;margin-top: 5px;margin-left: 8px;">回填后照片:</text>
  135. </view>
  136. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  137. <image :src="loadImgSrc('updateimg.png')" mode=""
  138. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; " @click="choose('hth',key)">
  139. </image>
  140. <view v-for="(item,index) in value.photosAfter" :key="index" style="position: relative;">
  141. <view
  142. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  143. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  144. @click="showPhoto(index,value.photosAfter)">
  145. </image>
  146. </view>
  147. <view v-else>
  148. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  149. </view>
  150. <view @click="removeht(index,key,'hth')"
  151. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  152. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  153. </image>
  154. </view>
  155. </view>
  156. </view>
  157. </view>
  158. <view v-if="title=='下沟'">
  159. <view class="cz-style" v-for="(a,index) in value.zEngineeringMaterialBo" :key="index">
  160. <view class="uni-media-list-text-top" style=" ">
  161. <view class="tit-text">材质:</view>
  162. <view class="uni-list-cell-db" style="margin-top: 10;"
  163. @click="pickerShow('cz',key,index)">
  164. <span
  165. style="color: black;">{{a.materialQualityName==''?'请选择材质':a.materialQualityName}}</span>
  166. </view>
  167. </view>
  168. <view class="uni-media-list-text-top" style=" ">
  169. <view class="tit-text">规格:</view>
  170. <view class="uni-list-cell-db" style="margin-top: 10;"
  171. @click="pickerShow('gg',key,index)">
  172. <span
  173. style="color: black;">{{a.specificationsName==''?'请选择规格':a.specificationsName}}</span>
  174. </view>
  175. </view>
  176. <view class="uni-media-list-text-top" style="border-bottom: 1px solid #f8f8f8;">
  177. <text class="tit-text">米 数</text>
  178. <view style="display: flex; justify-content: right; width: 70%;">
  179. <input class="uni-input" type="number" :value="getIntegerPart(a.number,0)"
  180. @change="setInfoBoNumber(key,index,$event.target.value,0)" maxlength="6"
  181. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  182. <text style="font-weight:bold;margin-left: 10px;margin-right: 10px;">.</text>
  183. <input class="uni-input" type="number" :value="getIntegerPart(a.number,1)"
  184. @change="setInfoBoNumber(key,index,$event.target.value,1)" maxlength="1"
  185. style="text-align: center; border: 1px solid #00aaff; border-radius: 20rpx;"></input>
  186. </view>
  187. </view>
  188. <button v-if="index!=0" @click="btnDel(key,index)" class="sc-btn">删除</button>
  189. </view>
  190. <button @click="btnAdd(key,index)" class="tj-btn">添加</button>
  191. <view class="uni-common-mt" style="width: 100%;">
  192. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  193. #000;margin-top: 5px; margin-left: 8px;">管道施工记录:</text>
  194. </view>
  195. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  196. <image :src="loadImgSrc('updateimg.png')" mode=""
  197. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; "
  198. @click="chooseType('gdsgjl',key)">
  199. </image>
  200. <view v-for="(item,index) in value.constructionRecords" :key="index"
  201. style="position: relative;">
  202. <view
  203. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  204. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  205. @click="showPhoto(index,value.constructionRecords)">
  206. </image>
  207. </view>
  208. <view v-else>
  209. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  210. </view>
  211. <view @click="removeht(index,key,'gdsgjl')"
  212. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  213. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  214. </image>
  215. </view>
  216. </view>
  217. </view>
  218. <view class="uni-common-mt" style="width: 100%;">
  219. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  220. #000;margin-top: 5px; margin-left: 8px;">管上皮深度测量照片:</text>
  221. </view>
  222. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  223. <image :src="loadImgSrc('updateimg.png')" mode=""
  224. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; "
  225. @click="chooseType('gspsdcl',key)">
  226. </image>
  227. <view v-for="(item,index) in value.ductalEpithelium" :key="index"
  228. style="position: relative;">
  229. <view
  230. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  231. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  232. @click="showPhoto(index,value.ductalEpithelium)">
  233. </image>
  234. </view>
  235. <view v-else>
  236. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  237. </view>
  238. <view @click="removeht(index,key,'gspsdcl')"
  239. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  240. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  241. </image>
  242. </view>
  243. </view>
  244. </view>
  245. <view class="uni-common-mt" style="width: 100%;">
  246. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  247. #000;margin-top: 5px;margin-left: 8px;">管沟远景照片:</text>
  248. </view>
  249. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  250. <image :src="loadImgSrc('updateimg.png')" mode=""
  251. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; "
  252. @click="chooseType('ggyj',key)">
  253. </image>
  254. <view v-for="(item,index) in value.trenchProspect" :key="index" style="position: relative;">
  255. <view
  256. v-if="item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' || item.substring(item.length - 3) == 'jpeg'">
  257. <image :src="item" mode="" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"
  258. @click="showPhoto(index,value.trenchProspect)">
  259. </image>
  260. </view>
  261. <view v-else>
  262. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  263. </view>
  264. <view @click="removeht(index,key,'ggyj')"
  265. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  266. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  267. </image>
  268. </view>
  269. </view>
  270. </view>
  271. <view class="uni-common-mt" style="width: 100%;">
  272. <text class="uni-title uni-common-pl" style=" font-size: 13px;color:
  273. #000;margin-top: 5px;margin-left: 8px;">视频:</text>
  274. </view>
  275. <view class="" style="display: flex; flex-wrap: wrap;margin-top: 10px;">
  276. <image :src="loadImgSrc('updateimg.png')" mode=""
  277. style="width: 200rpx; height: 150rpx; margin: 0 12rpx;; "
  278. @click="chooseType('video',key)">
  279. </image>
  280. <view v-for="(item,index) in value.video" :key="index" style="position: relative;">
  281. <view>
  282. <video :src="item" style="width: 100rpx; height: 100rpx; margin: 0 12rpx;"></video>
  283. </view>
  284. <view @click="removeht(index,key,'video')"
  285. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  286. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  287. </image>
  288. </view>
  289. </view>
  290. </view>
  291. </view>
  292. </view>
  293. </view>
  294. </view>
  295. <!-- <view class="gesture-area" v-show="playVideo" >
  296. <view @click="closeVideo()"
  297. style="position: absolute; top: 0; right: 14rpx; border-radius: 50%;">
  298. <image :src="loadImgSrc('icon_close.png')" style=" width: 15px; height: 15px;">
  299. </image>
  300. </view>
  301. <video :src="playVideoSrc"></video>
  302. </view> -->
  303. <SelectPicker :list="selectList" @change="changeSelect" v-if="open" @close="close" titleKey="name"
  304. subtitleKey="id">
  305. </SelectPicker>
  306. <SelectPicker :list="dictOptions" @change="changeSelectDict" v-if="openDict" @close="closeDict"
  307. titleKey="dictLabel" subtitleKey="dictValue" v-model="name"></SelectPicker>
  308. <view class="action-btn" v-if="hideButton==false">
  309. <button @click="submit" class="btn cu-btn block bg-blue lg round">确认</button>
  310. </view>
  311. </scroll-view>
  312. </template>
  313. <script>
  314. import SelectPicker from '../../components/selectPicker/select_picker.vue'
  315. import {
  316. getDicts
  317. } from "@/api/system/dict/data";
  318. import {
  319. getToken
  320. } from '../../utils/auth';
  321. import user from '@/store/modules/user'
  322. import {
  323. getHistoryDetails,
  324. getEnginMaterialQualityList,
  325. putHistory,
  326. getEnginSpecificationsList
  327. } from '@/api/common'
  328. export default {
  329. components: {
  330. SelectPicker,
  331. },
  332. data() {
  333. return {
  334. // playVideo: false,//视频播放放大
  335. // playVideoSrc:'',
  336. selectZbfList: [],
  337. dictOptions: [],
  338. openDict: false,
  339. dataIndex: 0, //数据用第几条
  340. selectIndex: 0, //材质规格用的第几条
  341. imageIndex: 0,
  342. headers: {
  343. Authorization: "Bearer " + getToken()
  344. },
  345. nodeId: '',
  346. type: '',
  347. title: '',
  348. dataJson: '',
  349. enginClassification: '',
  350. enginType: '',
  351. enginClassValue: '',
  352. selectList: [],
  353. open: false,
  354. selectType: '',
  355. hideButton: false,
  356. }
  357. },
  358. onLoad(options) {
  359. if ('params' in options) {
  360. let e = JSON.parse(decodeURIComponent(options.params));
  361. this.nodeId = e.id;
  362. this.type = e.type;
  363. getHistoryDetails(this.nodeId, this.type).then(response => {
  364. if (response.data.zEngineeringNodeBo != null) {
  365. this.hideButton = false;
  366. this.dataJson = response.data;
  367. this.title = response.data.zEngineeringNodeBo.type;
  368. this.enginType = response.data.enginType;
  369. this.enginClassification = response.data.enginClassification;
  370. } else {
  371. this.hideButton = true;
  372. this.$modal.msg("暂无历史信息")
  373. }
  374. });
  375. }
  376. },
  377. methods: {
  378. //关闭弹窗
  379. close(e) {
  380. this.open = false
  381. },
  382. btnAdd(key, index) {
  383. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].zEngineeringMaterialBo.push({
  384. 'materialQuality': '',
  385. 'materialQualityName': '',
  386. 'number': '',
  387. 'specifications': '',
  388. 'specificationsName': ''
  389. });
  390. },
  391. btnDel(key, index) {
  392. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].zEngineeringMaterialBo.splice(index, 1);
  393. },
  394. pickerShow(e, index, indexTwo) {
  395. this.dataIndex = index;
  396. this.selectIndex = indexTwo; //材质规格 第几条
  397. this.selectType = e;
  398. if (e == 'cz') {
  399. this.open = true;
  400. getEnginMaterialQualityList("民用工程", this.enginType, this.enginClassification, this.title)
  401. .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 == 'sfht') {
  464. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].stonePowder
  465. .splice(index, 1)
  466. } else if (type == 'jsdps') {
  467. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].warningtTape
  468. .splice(index, 1)
  469. } else if (type == 'hth') {
  470. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key].photosAfter
  471. .splice(index, 1)
  472. } else if (type == 'gdsgjl') {
  473. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key]
  474. .constructionRecords
  475. .splice(index, 1)
  476. } else if (type == 'gspsdcl') {
  477. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key]
  478. .ductalEpithelium
  479. .splice(index, 1)
  480. } else if (type == 'ggyj') {
  481. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key]
  482. .trenchProspect
  483. .splice(index, 1)
  484. } else if (type == 'video') {
  485. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList[key]
  486. .video
  487. .splice(index, 1)
  488. }
  489. }
  490. }
  491. })
  492. },
  493. remove(index, key) {
  494. uni.showModal({
  495. title: '提示',
  496. content: '是否删除该图片或视频?',
  497. success: (res) => {
  498. if (res.confirm) {
  499. this.dataJson.zEngineeringNodeBo
  500. .zEngineeringInfoBoList[key]
  501. .zEngiineeringPhotoBoList.splice(index, 1)
  502. }
  503. }
  504. })
  505. },
  506. chooseType(type, index) {
  507. this.dataIndex = index;
  508. let _this = this;
  509. if (type == 'video') {
  510. this.choosevideo(type)
  511. } else {
  512. this.chooseimage(type)
  513. }
  514. },
  515. choose(type, index) {
  516. this.dataIndex = index;
  517. let _this = this;
  518. uni.showActionSheet({
  519. title: '上传',
  520. itemList: ['图片', '视频'],
  521. success: (res) => {
  522. if (res.tapIndex == 0) {
  523. this.chooseimage(type)
  524. } else {
  525. this.choosevideo(type)
  526. }
  527. }
  528. })
  529. },
  530. chooseimage(e) {
  531. let _this = this;
  532. uni.chooseImage({
  533. sizeType: ['album', 'camera'],
  534. success(resp) {
  535. resp.tempFiles.forEach((item, index) => {
  536. const task = uni.uploadFile({
  537. url: _this.$HTTP + `/obs`,
  538. filePath: item.path,
  539. name: 'file',
  540. formData: {},
  541. header: _this.headers,
  542. success: res => {
  543. let data = JSON.parse(res.data);
  544. if (![200].includes(data.code)) {
  545. _this.$modal.msg(data.msg)
  546. } else {
  547. if (_this.progress === 100) {
  548. if (e == 'other') {
  549. _this.dataJson.zEngineeringNodeBo
  550. .zEngineeringInfoBoList[_this.dataIndex]
  551. .zEngiineeringPhotoBoList.push(data.data
  552. .url);
  553. } else if (e == 'sfht') {
  554. _this.dataJson.zEngineeringNodeBo
  555. .zEngineeringInfoBoList[_this.dataIndex]
  556. .stonePowder.push(data.data
  557. .url);
  558. } else if (e == 'jsdps') {
  559. _this.dataJson.zEngineeringNodeBo
  560. .zEngineeringInfoBoList[_this.dataIndex]
  561. .warningtTape.push(data.data
  562. .url);
  563. } else if (e == 'hth') {
  564. _this.dataJson.zEngineeringNodeBo
  565. .zEngineeringInfoBoList[_this.dataIndex]
  566. .photosAfter.push(data.data
  567. .url);
  568. } else if (e == 'gdsgjl') {
  569. _this.dataJson.zEngineeringNodeBo
  570. .zEngineeringInfoBoList[_this.dataIndex]
  571. .constructionRecords.push(data.data
  572. .url);
  573. } else if (e == 'gspsdcl') {
  574. _this.dataJson.zEngineeringNodeBo
  575. .zEngineeringInfoBoList[_this.dataIndex]
  576. .ductalEpithelium.push(data.data
  577. .url);
  578. } else if (e == 'ggyj') {
  579. _this.dataJson.zEngineeringNodeBo
  580. .zEngineeringInfoBoList[_this.dataIndex]
  581. .trenchProspect.push(data.data
  582. .url);
  583. }
  584. _this.$modal.msg('上传成功!')
  585. }
  586. }
  587. },
  588. fail: e => {
  589. _this.$modal.msg('上传失败!')
  590. },
  591. complete: res => {
  592. uni.hideLoading();
  593. _this.uploading = false;
  594. }
  595. });
  596. task.onProgressUpdate(res => {
  597. _this.progress = res.progress;
  598. uni.showLoading({
  599. title: '上传中'
  600. })
  601. if (_this.progress != 100) {
  602. _this.loading = false
  603. } else {
  604. _this.loading = true
  605. }
  606. });
  607. })
  608. },
  609. })
  610. },
  611. choosevideo(e) {
  612. let _this = this;
  613. uni.chooseVideo({
  614. sourceType: ['album', 'camera'],
  615. maxDuration: 30,
  616. success(resp) {
  617. const task = uni.uploadFile({
  618. url: _this.$HTTP + `/obs`,
  619. filePath: resp.tempFilePath,
  620. name: 'file',
  621. formData: {},
  622. header: _this.headers,
  623. success: res => {
  624. let data = JSON.parse(res.data);
  625. if (![200].includes(res.statusCode)) {
  626. this.uploadError(index, data);
  627. } else {
  628. //上传成功
  629. if (_this.progress === 100) {
  630. if (e == 'other') {
  631. _this.dataJson.zEngineeringNodeBo
  632. .zEngineeringInfoBoList[_this.dataIndex]
  633. .zEngiineeringPhotoBoList.push(data.data.url);
  634. } else if (e == 'sfht') {
  635. _this.dataJson.zEngineeringNodeBo
  636. .zEngineeringInfoBoList[_this.dataIndex]
  637. .stonePowder.push(data.data.url);
  638. } else if (e == 'jsdps') {
  639. _this.dataJson.zEngineeringNodeBo
  640. .zEngineeringInfoBoList[_this.dataIndex]
  641. .warningtTape.push(data.data.url);
  642. } else if (e == 'hth') {
  643. _this.dataJson.zEngineeringNodeBo
  644. .zEngineeringInfoBoList[_this.dataIndex]
  645. .photosAfter.push(data.data.url);
  646. } else if (e == 'video') {
  647. _this.dataJson.zEngineeringNodeBo
  648. .zEngineeringInfoBoList[_this.dataIndex]
  649. .video.push(data.data.url);
  650. }
  651. _this.$modal.msg('上传成功!')
  652. }
  653. }
  654. },
  655. fail: e => {
  656. _this.$modal.msg('上传失败!')
  657. this.uploadError(index, e);
  658. },
  659. complete: res => {
  660. uni.hideLoading();
  661. _this.uploading = false;
  662. }
  663. });
  664. task.onProgressUpdate(res => {
  665. _this.progress = res.progress;
  666. uni.showLoading({
  667. title: '上传中'
  668. })
  669. if (_this.progress != 100) {
  670. _this.loading = false
  671. } else {
  672. _this.loading = true
  673. }
  674. });
  675. },
  676. })
  677. },
  678. showPhoto(index, arr) {
  679. let newArr = [];
  680. arr.forEach((item, index) => {
  681. if (item.substring(item.length - 3) == 'png' || item.substring(item.length - 3) == 'jpg' ||
  682. item.substring(item.length - 4) == 'jpeg') {
  683. newArr.push(item)
  684. }
  685. });
  686. uni.previewImage({
  687. current: index,
  688. urls: newArr,
  689. })
  690. },
  691. // showVideo(arr) {
  692. // this.playVideo = true;
  693. // this.playVideoSrc = arr;
  694. // },
  695. // closeVideo(){
  696. // this.playVideo = false;
  697. // },
  698. isEmpty(str) {
  699. return (!str || 0 === str.length);
  700. },
  701. isEdit(item) {
  702. var isShow = item.createBy == this.$user.state.name;
  703. return isShow;
  704. },
  705. submit() {
  706. let isSubmit = true;
  707. if (this.title == '回填') {
  708. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList.forEach((res) => {
  709. if (res.stonePowder.length == 0) {
  710. this.$modal.msg("请上传石粉回填照片");
  711. isSubmit = false;
  712. }
  713. if (res.warningtTape.length == 0) {
  714. this.$modal.msg("请上传警示带铺设照片");
  715. isSubmit = false;
  716. }
  717. if (res.photosAfter.length == 0) {
  718. this.$modal.msg("请上传回填后照片");
  719. isSubmit = false;
  720. }
  721. })
  722. } else if (this.title == '下沟') {
  723. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList.forEach((res) => {
  724. res.zEngineeringMaterialBo.forEach((itme) => {
  725. if (itme.specifications == '') {
  726. this.$modal.msg("请选择规格");
  727. isSubmit = false;
  728. }
  729. if (itme.number == '') {
  730. this.$modal.msg("请输入米数");
  731. isSubmit = false;
  732. }
  733. })
  734. if (res.constructionRecords.length <= 0) {
  735. this.$modal.msg('请上传管道施工记录照片')
  736. isSubmit = false;
  737. }
  738. if (res.ductalEpithelium.length <= 0) {
  739. this.$modal.msg('请上传管上皮深度测量照片')
  740. isSubmit = false;
  741. }
  742. if (res.trenchProspect.length <= 0) {
  743. this.$modal.msg('请上传管沟远景照片')
  744. isSubmit = false;
  745. }
  746. if (res.video.length <= 0) {
  747. this.$modal.msg('请上传视频')
  748. isSubmit = false;
  749. }
  750. })
  751. } else {
  752. if (this.title == '全貌照片') {
  753. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList.forEach((res) => {
  754. res.zEngineeringMaterialBo.forEach((itme) => {
  755. if (itme.specifications == '') {
  756. this.$modal.msg("请选择规格");
  757. isSubmit = false;
  758. }
  759. if (itme.number == '') {
  760. this.$modal.msg("请输入米数");
  761. isSubmit = false;
  762. }
  763. })
  764. })
  765. }
  766. this.dataJson.zEngineeringNodeBo.zEngineeringInfoBoList.forEach((res) => {
  767. if (res.zEngiineeringPhotoBoList.length == 0) {
  768. this.$modal.msg("请上传照片");
  769. isSubmit = false;
  770. }
  771. })
  772. }
  773. if (!isSubmit) {
  774. return
  775. }
  776. putHistory(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: left;
  878. margin: 30rpx 35rpx;
  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>