historyDetailMunicipal.vue 24 KB

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