historyDetailMunicipal.vue 25 KB

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