historyDetails.vue 23 KB

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