historyDetailsEnginproject.vue 25 KB

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