historyDetails.vue 22 KB

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