historyDetailMunicipal.vue 25 KB

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