conductInspections.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948
  1. <!-- 开展检查 -->
  2. <template>
  3. <view class="inspectAdd">
  4. <scroll-view scroll-y @scrolltolower="scrollGet" class="info-max-box">
  5. <view class="list">
  6. <view class="list-li srearch">
  7. <view class="srearch-l">{{newData.subName?newData.subName:'实验室名称'}}</view>
  8. </view>
  9. <view class="list-li" style="margin-bottom: 20rpx;border:none;">
  10. <view>
  11. {{newData.roomNum?newData.roomNum:''}}房间&{{newData.buildName?newData.buildName:'楼栋'}}&{{newData.deptName?newData.deptName:'学院单位'}}
  12. </view>
  13. </view>
  14. <view class="list-li">
  15. <view>现场照片</view>
  16. </view>
  17. <view v-if="form.photoList[0]" class="check-for-img-max-box">
  18. <view class="left-title-p"></view>
  19. <view class="right-img-box">
  20. <view class="img-box" v-for="(imgUrl,imgIndex) in form.photoList" :key="imgIndex">
  21. <img class="img-data" :src="baseUrl+imgUrl.fileUrl">
  22. <img class="position-img" :src="imagesUrl('commonality/icon_ssp_closure.png')"
  23. @click="delImg(imgIndex)">
  24. </view>
  25. <!-- <img class="add-button" :src="imagesUrl('safetyCheck/img_ssp_pz@1x.png')"
  26. @click="selectImage()" v-if="form.photoList.length<6"> -->
  27. </view>
  28. </view>
  29. <view class="list-li" @click="checkItemModuleButton('open')" style="border-bottom: none;">
  30. <view> {{newData.hazardCheckCode?newData.hazardCheckCode:''}}
  31. {{newData.hazardCheckName?newData.hazardCheckName:'检查项'}}
  32. </view>
  33. <view style="color: #0183FA;">
  34. <img :src="imagesUrl('commonality/icon_wd_gd@1x.png')">
  35. </view>
  36. </view>
  37. <view class="hazardCheckNum" @click="hiddenDangerClick()">
  38. <img class="hazardCheckNum-l" :src="imagesUrl('safetyCheck/icon_aqjc_yinhuan.png')">
  39. <view class="hazardCheckNum-r">{{'已连续出现'+hazardCheckNum+'次隐患'}} </view>
  40. </view>
  41. <view class="list-li" v-if="!form.checkFlag">
  42. <view>隐患描述</view>
  43. <view></view>
  44. </view>
  45. <view class="describe">
  46. <textarea v-if="!form.checkFlag && !checkItemModuleType" cursor-spacing="40" class="describe-n" type="text"
  47. v-model="form.hazardDescribe" maxlength="200" placeholder="请填写隐患描述"
  48. placeholder-style="font-size:24rpx;color:#999;"></textarea>
  49. </view>
  50. </view>
  51. <view class="voice">
  52. <view class="voice_t">
  53. <view class="voice_t_t" v-if="!form.voiceList[0]"><text>语音备注:</text><text>按住话筒录音</text></view>
  54. <view class="voice_t_b" v-if="form.voiceList[0]">语音备注:({{form.voiceList.length}})</view>
  55. </view>
  56. <view class="voice_b" v-if="form.voiceList[0]" v-for="(voiceItem,voiceIndex) in form.voiceList"
  57. :key="voiceIndex">
  58. <view class="voice_b_l" @tap="voicePlay(voiceItem.fileUrl)">
  59. <img class="add-button" :src="imagesUrl('safetyCheck/icon_yybz_yy.png')" />
  60. {{voiceItem.fileLength}}″
  61. </view>
  62. <img class="voice_b_r" :src="imagesUrl('safetyCheck/icon_yybz_sc.png')"
  63. @tap="voiceDele('',voiceIndex)" />
  64. </view>
  65. <!-- <view class="voice-btn">
  66. <img class="voice_t_r" :src="imagesUrl('commonality/icon_sskz_azsh.png')"
  67. @longpress.stop="recordButton(item,$event)" @touchmove.stop="cancelButton"
  68. @touchend.stop="sendButton(item,$event)" />
  69. <text>按住说话</text>
  70. </view> -->
  71. </view>
  72. </scroll-view>
  73. <checkItemModule :propsData="propsData" v-if="checkItemModuleType"></checkItemModule>
  74. <!-- <view class="sub-btn">
  75. <view @click="submitForm(1)">保存草稿</view>
  76. <view @click="submitForm(2)">提交</view>
  77. </view> -->
  78. <view class="sub-btn" v-if="!checkItemModuleType">
  79. <img @longpress.stop="recordButton(item,$event)" @touchmove.stop="cancelButton"
  80. @touchend.stop="sendButton(item,$event)" :src="imagesUrl('safetyCheck/icon_aqjc_luyin.png')" />
  81. <img @click="selectImage()" :src="imagesUrl('safetyCheck/icon_aqjc_paizhao.png')" />
  82. <img @click="submitForm(2)" :src="imagesUrl('safetyCheck/icon_aqjc_tijiao.png')" />
  83. </view>
  84. <view v-if="!checkItemModuleType" class="inspectRecord" @click="inspectRecordClick()">检查记录</view>
  85. </view>
  86. </template>
  87. <script>
  88. const myaudio = uni.createInnerAudioContext();
  89. import {
  90. config
  91. } from '@/api/request/config.js'
  92. import {
  93. securityAppCheckPlanCheckInfo,
  94. securityAppCheckSetOptionCheckCommit,
  95. securityAppCheckPhotoGetCheckNumBySub,
  96. } from '@/pages_safetyCheck/api/index.js'
  97. import {
  98. checkItemModule
  99. } from '@/pages_safetyCheck/component/checkItemModule.vue'
  100. export default {
  101. name: "inspectAdd",
  102. components: {
  103. checkItemModule
  104. },
  105. data() {
  106. return {
  107. baseUrl: config.base_url,
  108. form: {
  109. checkFlag: false,
  110. photoList: [],
  111. voiceList: [],
  112. },
  113. newData: {},
  114. radioList: [{
  115. id: 1,
  116. name: '符合',
  117. checked: false,
  118. },
  119. {
  120. id: 0,
  121. name: '不符合',
  122. checked: true,
  123. },
  124. ],
  125. pageType: '',
  126. sendLock: true, //发送锁,当为true时上锁,false时解锁发送
  127. recorderManager: wx.getRecorderManager(),
  128. optionData: null,
  129. //检查项组件数据
  130. checkItemModuleType: false,
  131. propsData: {},
  132. hazardCheckNum:0,
  133. }
  134. },
  135. onLoad(option) {
  136. let optionData = JSON.parse(decodeURIComponent(option.infoData));
  137. uni.setNavigationBarTitle({
  138. title: optionData.subName + '(' + (optionData.pageType == 0 ? (optionData.roomNum ? optionData
  139. .roomNum : '-') : (optionData
  140. .subRoom ? optionData
  141. .subRoom : '-')) + ')'
  142. })
  143. this.$set(this, 'pageType', optionData.pageType);
  144. this.$set(this, 'optionData', optionData);
  145. },
  146. onShow() {
  147. },
  148. mounted() {
  149. if (this.pageType == 0) {
  150. this.securityAppCheckPlanCheckInfo();
  151. this.securityAppCheckPhotoGetCheckNumBySub();
  152. }
  153. },
  154. methods: {
  155. //折叠展开
  156. inspectDot() {
  157. this.newData.inspectDot = !this.newData.inspectDot
  158. },
  159. //检查记录
  160. inspectRecordClick(){
  161. let infoData = this.optionData;
  162. infoData.curTabTow=1;//已检查
  163. uni.navigateTo({
  164. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItems?infoData=' +
  165. encodeURIComponent(JSON
  166. .stringify(infoData))
  167. });
  168. },
  169. //获取提交详情
  170. async securityAppCheckPlanCheckInfo() {
  171. let obj = {
  172. setOptionId: this.optionData.setOptionId,
  173. manageId: this.optionData.manageId,
  174. }
  175. const {
  176. data
  177. } = await securityAppCheckPlanCheckInfo(obj);
  178. if (data.code == 200) {
  179. data.data.inspectDot = true;
  180. this.$set(this, 'newData', data.data);
  181. //编辑的时候
  182. this.$set(this.form, 'checkFlag', data.data.checkFlag ? data.data.checkFlag : false);
  183. if(data.data.hazardDescribe){
  184. this.$set(this.form, 'hazardDescribe', data.data.hazardDescribe);
  185. }else{
  186. this.$set(this.newData,'hazardCheckPro',this.optionData.hazardCheckPro);
  187. this.$set(this.newData,'hazardCheckCode',this.optionData.hazardCheckCode);
  188. this.$set(this.newData,'hazardCheckName',this.optionData.hazardCheckName);
  189. this.$set(this.newData,'hazardCheckPro1',this.optionData.hazardCheckPro1);
  190. this.$set(this.newData,'hazardCheckCode1',this.optionData.hazardCheckCode1);
  191. this.$set(this.newData,'hazardCheckName1',this.optionData.hazardCheckName1);
  192. this.$set(this.newData,'hazardCheckPro2',this.optionData.hazardCheckPro2);
  193. this.$set(this.newData,'hazardCheckCode2',this.optionData.hazardCheckCode2);
  194. this.$set(this.newData,'hazardCheckName2',this.optionData.hazardCheckName2);
  195. this.$set(this.newData,'hazardCheckPoint',this.optionData.hazardCheckPoint);
  196. this.$set(this.form,'hazardDescribe',this.optionData.hazardCheckPoint);
  197. // let list=[];
  198. // list=data.data.hazardCheckPoint.split('#');
  199. // this.$set(this.form, 'hazardDescribe', list[0]);
  200. }
  201. this.$set(this.form, 'photoList', data.data.photoList ? data.data.photoList : []);
  202. this.$set(this.form, 'voiceList', data.data.voiceList ? data.data.voiceList : []);
  203. }
  204. },
  205. hiddenDangerClick(row) {
  206. if(!this.hiddenDangerRecordStatus){
  207. let infoData = this.optionData;
  208. infoData.subName=this.newData.subName;
  209. infoData.roomNum=this.newData.roomNum;
  210. infoData.hiddenDangerRecordStatus = true;//判断是否跳转隐患列表
  211. uni.navigateTo({
  212. url: '/pages_safetyCheck/views/inspectManage/hiddenDangerRecord?infoData=' +
  213. encodeURIComponent(JSON.stringify(infoData))
  214. });
  215. }
  216. },
  217. checkItemModuleButton(type, item,keyPoint) {
  218. if (type == 'open') {
  219. let obj = {
  220. infoType: this.pageType,
  221. checkType: 0,
  222. editStatus:this.optionData.editStatus,
  223. editItem:{
  224. hazardCheckName:this.newData.hazardCheckName,
  225. hazardCheckName1:this.newData.hazardCheckName1,
  226. hazardCheckName2:this.newData.hazardCheckName2,
  227. hazardCheckCode:this.newData.hazardCheckCode,
  228. hazardCheckCode1:this.newData.hazardCheckCode1,
  229. hazardCheckCode2:this.newData.hazardCheckCode2,
  230. hazardCheckPoint:this.newData.hazardCheckPoint,
  231. hazardCheckPro:this.newData.hazardCheckPro,
  232. hazardCheckPro1:this.newData.hazardCheckPro1,
  233. hazardCheckPro2:this.newData.hazardCheckPro2,
  234. setOptionId:this.newData.setOptionId,
  235. }
  236. }
  237. if (this.pageType == 0) {
  238. //检查
  239. obj.manageId = this.optionData.manageId
  240. obj.planSetId = this.optionData.planSetId
  241. }
  242. this.$set(this, 'propsData', obj);
  243. this.$set(this, 'checkItemModuleType', true);
  244. } else if (type == 'out') {
  245. this.$set(this, 'checkItemModuleType', false);
  246. this.$set(this, 'propsData', {});
  247. } else if (type == 'submit') {
  248. this.$set(this.newData, 'hazardCheckPro', item.hazardCheckPro);
  249. this.$set(this.newData, 'hazardCheckCode', item.hazardCheckCode);
  250. this.$set(this.newData, 'hazardCheckName', item.hazardCheckName);
  251. this.$set(this.newData, 'hazardCheckPro1', item.hazardCheckPro1);
  252. this.$set(this.newData, 'hazardCheckCode1', item.hazardCheckCode1);
  253. this.$set(this.newData, 'hazardCheckName1', item.hazardCheckName1);
  254. this.$set(this.newData, 'hazardCheckPro2', item.hazardCheckPro2);
  255. this.$set(this.newData, 'hazardCheckCode2', item.hazardCheckCode2);
  256. this.$set(this.newData, 'hazardCheckName2', item.hazardCheckName2);
  257. this.$set(this.newData, 'hazardCheckPoint', item.hazardCheckPoint);
  258. this.$set(this.form, 'hazardDescribe', keyPoint);
  259. // this.$set(this.optionData, 'setOptionId', item.setOptionId);
  260. this.$set(this.optionData, 'hazardCheckPro', item.hazardCheckPro);
  261. this.$set(this, 'checkItemModuleType', false);
  262. this.securityAppCheckPhotoGetCheckNumBySub();
  263. //编辑的时候
  264. if(this.optionData.editStatus){
  265. if(this.optionData.setOptionId!=this.newData.setOptionId){
  266. this.$set(this.form, 'photoList', []);
  267. this.$set(this.form, 'voiceList', []);
  268. }
  269. }
  270. }
  271. },
  272. //提交
  273. async submitForm(status) {
  274. if (!this.form.checkFlag) {
  275. if (!this.form.hazardDescribe) {
  276. uni.showToast({
  277. title: '请填写隐患描述!',
  278. icon: "none",
  279. mask: true,
  280. duration: 2000
  281. });
  282. return
  283. }
  284. if (!this.form.photoList[0]) {
  285. uni.showToast({
  286. title: '请选择现场照片!',
  287. icon: "none",
  288. mask: true,
  289. duration: 2000
  290. });
  291. return
  292. }
  293. }
  294. let obj = {
  295. checkFlag: this.form.checkFlag,
  296. checkStatus: 1,
  297. hazardDescribe: this.form.hazardDescribe,
  298. photoList: this.form.photoList,
  299. voiceList: this.form.voiceList,
  300. manageId: this.optionData.manageId,
  301. hazardCheckPro: this.newData.hazardCheckPro,
  302. hazardCheckCode: this.newData.hazardCheckCode,
  303. hazardCheckName: this.newData.hazardCheckName,
  304. hazardCheckPro2: this.newData.hazardCheckPro2,
  305. hazardCheckCode2: this.newData.hazardCheckCode2,
  306. hazardCheckName2: this.newData.hazardCheckName2,
  307. hazardCheckPro1: this.newData.hazardCheckPro1,
  308. hazardCheckCode1: this.newData.hazardCheckCode1,
  309. hazardCheckName1: this.newData.hazardCheckName1,
  310. hazardCheckPoint: this.form.hazardDescribe,
  311. }
  312. if(this.optionData.setOptionId){
  313. obj.setOptionId = this.optionData.setOptionId;
  314. }
  315. const {
  316. data
  317. } = await securityAppCheckSetOptionCheckCommit(obj);
  318. if (data.code == 200) {
  319. uni.showToast({
  320. title: '提交成功!',
  321. icon: "none",
  322. mask: true,
  323. duration: 2000
  324. });
  325. let infoData = this.optionData;
  326. infoData.setOptionId = data.data;
  327. uni.redirectTo({
  328. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  329. encodeURIComponent(JSON
  330. .stringify(infoData))
  331. });
  332. }
  333. },
  334. //获取检查项在当前实验室出现的次数
  335. async securityAppCheckPhotoGetCheckNumBySub() {
  336. let obj = {
  337. subId: this.optionData.subId,
  338. hazardCheckPro: this.optionData.hazardCheckPro,
  339. }
  340. const {
  341. data
  342. } = await securityAppCheckPhotoGetCheckNumBySub(obj);
  343. if (data.code == 200) {
  344. this.$set(this, 'hazardCheckNum', data.data);
  345. }
  346. },
  347. //滚动事件
  348. scrollGet() {},
  349. //单选按钮
  350. radioClick(d) {
  351. let self = this;
  352. d.checked = !d.checked
  353. if (d.checked) {
  354. //如果有选中的,循环把其他选中的取消
  355. this.radioList.forEach(function(item) {
  356. if (item.id == d.id) {
  357. self.$set(self.form, 'checkFlag', item.id);
  358. } else {
  359. item.checked = false;
  360. }
  361. })
  362. } else {
  363. }
  364. },
  365. /******图片上传******/
  366. selectImage() {
  367. let self = this;
  368. let photoMaxNun = 0;
  369. if (this.form.photoList.length > 5) {
  370. uni.showToast({
  371. title: '最多上传6张图片',
  372. icon: "none",
  373. mask: true,
  374. duration: 2000
  375. });
  376. return
  377. }
  378. photoMaxNun = 6 - this.form.photoList.length;
  379. wx.chooseImage({
  380. count: photoMaxNun,
  381. sizeType: ["original", "compressed"],
  382. sourceType: ["album", "camera"],
  383. success: function(res) {
  384. if (res.tempFilePaths[0]) {
  385. res.tempFilePaths.forEach(function(item, index) {
  386. self.uploadImg(item);
  387. })
  388. }
  389. }
  390. });
  391. },
  392. async uploadImg(tempFilePaths) {
  393. var self = this;
  394. uni.showLoading({
  395. title: '上传中',
  396. mask: true
  397. });
  398. uni.uploadFile({
  399. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  400. header: {
  401. 'Authorization': uni.getStorageSync('token')
  402. },
  403. filePath: tempFilePaths,
  404. name: 'file',
  405. formData: {
  406. 'user': 'test'
  407. },
  408. success: (uploadFileRes) => {
  409. let res = JSON.parse(uploadFileRes.data);
  410. if (res.code == 200) {
  411. this.form.photoList.push({
  412. 'fileUrl': res.data.url,
  413. 'fileName': res.data.name
  414. });
  415. } else {
  416. uni.showToast({
  417. title: res.msg,
  418. icon: "none",
  419. mask: true,
  420. duration: 2000
  421. });
  422. }
  423. },
  424. fail: err => {},
  425. complete: () => {
  426. uni.hideLoading()
  427. }
  428. });
  429. },
  430. //删除图片
  431. delImg(minIndex) {
  432. this.form.photoList.splice(minIndex, 1);
  433. this.$forceUpdate();
  434. },
  435. /******语音备注 *******/
  436. //语音备忘播放
  437. async voicePlay(item) {
  438. myaudio.src = config.base_url + item;
  439. myaudio.play();
  440. },
  441. //语音备忘删除
  442. async voiceDele(item, voiceIndex) {
  443. let self = this;
  444. uni.showModal({
  445. title: '',
  446. cancelColor: '#999999',
  447. confirmColor: '#FF6E6E',
  448. content: '确定删除此语音吗?',
  449. success(res) {
  450. if (res.confirm) {
  451. console.log('用户点击确定')
  452. self.form.voiceList.splice(voiceIndex, 1);
  453. self.$forceUpdate();
  454. } else if (res.cancel) {
  455. console.log('用户点击取消')
  456. }
  457. }
  458. })
  459. },
  460. //录制
  461. recordButton(item, e) {
  462. console.log("按下")
  463. let self = this;
  464. if (this.form.voiceList.length >= 5) {
  465. uni.showToast({
  466. title: '语音备忘最多只能上传5条',
  467. icon: "none",
  468. mask: true,
  469. duration: 2000
  470. });
  471. return
  472. }
  473. this.liveType = true;
  474. console.log('录制', e)
  475. this.startPoint = e.touches[0]; //记录长按时开始点信息,后面用于计算上划取消时手指滑动的距离。
  476. const options = {
  477. duration: 60000,
  478. sampleRate: 16000,
  479. numberOfChannels: 1,
  480. encodeBitRate: 48000,
  481. format: 'mp3',
  482. frameSize: 50
  483. }
  484. this.recorderManager.start(options); //开始录音
  485. this.recorderManager.onStart(() => {
  486. console.log('recorder start')
  487. })
  488. this.recorderManager.onError((res) => {
  489. console.log(res);
  490. })
  491. wx.showToast({
  492. title: "正在录音,上划取消发送",
  493. icon: "none",
  494. duration: 60000 //先定义个60秒,后面可以手动调用wx.hideToast()隐藏
  495. });
  496. this.sendLock = false; //长按时是不上锁的。
  497. },
  498. //取消
  499. cancelButton(e) {
  500. console.log("移动")
  501. let self = this;
  502. this.liveType = false;
  503. console.log('取消', e)
  504. let moveLenght = e.touches[e.touches.length - 1].clientY - this.startPoint.clientY; //移动距离
  505. if (Math.abs(moveLenght) > 50) {
  506. wx.showToast({
  507. title: "松开手指,取消发送",
  508. icon: "none",
  509. duration: 60000
  510. });
  511. this.sendLock = true; //触发了上滑取消发送,上锁
  512. } else {
  513. wx.showToast({
  514. title: "正在录音,上划取消发送",
  515. icon: "none",
  516. duration: 60000
  517. });
  518. this.sendLock = false; //上划距离不足,依然可以发送,不上锁
  519. }
  520. },
  521. //发送
  522. sendButton(item, e) {
  523. console.log("松开")
  524. let self = this;
  525. this.liveType = false;
  526. console.log('发送', e)
  527. wx.hideToast(); //结束录音、隐藏Toast提示框
  528. this.recorderManager.stop(); //结束录音
  529. this.recorderManager.onStop((res) => {
  530. if (!this.sendLock) {
  531. this.uploadVoice(item, res.duration, res.tempFilePath);
  532. }
  533. console.log('停止录音', res.tempFilePath)
  534. console.log("sendLock", this.sendLock);
  535. })
  536. },
  537. //上传MP3
  538. async uploadVoice(item, times, tempFilePaths) {
  539. var self = this;
  540. uni.uploadFile({
  541. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  542. header: {
  543. 'Authorization': uni.getStorageSync('token')
  544. },
  545. filePath: tempFilePaths,
  546. name: 'file',
  547. formData: {
  548. 'user': 'test'
  549. },
  550. success: (uploadFileRes) => {
  551. let res = JSON.parse(uploadFileRes.data);
  552. if (res.code == 200) {
  553. console.log("上传成功", res)
  554. console.log(item)
  555. let seconds = Math.round((parseInt(times) % (1000 * 60)) / 1000);
  556. this.form.voiceList.push({
  557. 'fileLength': seconds,
  558. 'fileUrl': res.data.url,
  559. 'fileName': res.data.name
  560. })
  561. console.log(JSON.stringify(self.voice))
  562. //self.textParseUrlIps(res.data.url);
  563. // self.newData.imgList.push(res.data.url);
  564. } else {
  565. uni.showToast({
  566. title: res.msg,
  567. icon: "none",
  568. mask: true,
  569. duration: 2000
  570. });
  571. }
  572. },
  573. fail: err => {
  574. uni.hideLoading()
  575. },
  576. complete: () => {}
  577. });
  578. },
  579. }
  580. }
  581. </script>
  582. <style lang="stylus" scoped>
  583. .inspectAdd {
  584. height: 100%;
  585. display flex;
  586. box-sizing: border-box;
  587. padding-bottom: 230rpx;
  588. box-sizing: border-box;
  589. .tip {
  590. width: 750rpx;
  591. height: 80rpx;
  592. background: rgba(1, 131, 250, 0.2);
  593. font-weight: normal;
  594. font-size: 28rpx;
  595. color: #0183FA;
  596. line-height: 80rpx;
  597. text-align: center;
  598. }
  599. .list {
  600. width: 750rpx;
  601. margin: 20rpx 0rpx 0;
  602. border-radius: 20rpx 20rpx 20rpx 20rpx;
  603. overflow: hidden;
  604. .list-li {
  605. display: flex;
  606. justify-content: space-between;
  607. align-items: center;
  608. padding: 0 30rpx;
  609. box-sizing: border-box;
  610. border-bottom: 1rpx solid #E0E0E0;
  611. background: #fff;
  612. >view:nth-of-type(1) {
  613. font-size: 30rpx;
  614. color: #333333;
  615. line-height: 100rpx;
  616. text-align: left;
  617. overflow: hidden;
  618. text-overflow: ellipsis;
  619. white-space: nowrap;
  620. }
  621. >view:nth-of-type(2) {
  622. font-size: 28rpx;
  623. color: #666666;
  624. line-height: 100rpx;
  625. text-align: left;
  626. display: flex;
  627. justify-content: space-between;
  628. align-items: center;
  629. >img {
  630. width: 30rpx;
  631. height: 30rpx;
  632. margin-left: 10rpx;
  633. }
  634. }
  635. }
  636. .hidden-content {
  637. width: 630rpx;
  638. min-height: 200rpx;
  639. background: #F5F5F5;
  640. border-radius: 20rpx 20rpx 20rpx 20rpx;
  641. margin: 20rpx 30rpx 0;
  642. padding: 20rpx;
  643. box-sizing: border-box;
  644. font-size: 28rpx;
  645. color: #666666;
  646. line-height: 39rpx;
  647. text-align: left;
  648. }
  649. .photo {
  650. display: flex;
  651. justify-content: flex-start;
  652. flex-wrap: wrap;
  653. margin-top: 20rpx;
  654. padding: 0 30rpx;
  655. box-sizing: border-box;
  656. >img {
  657. width: 150rpx;
  658. height: 150rpx;
  659. border-radius: 10rpx 10rpx 10rpx 10rpx;
  660. margin: 0 10rpx 10rpx 0;
  661. }
  662. >img:nth-of-type(4) {
  663. margin-right: 0;
  664. }
  665. }
  666. .describe {
  667. width: 750rpx;
  668. background: #fff;
  669. overflow: hidden;
  670. .describe-n {
  671. width: 690rpx;
  672. min-height: 180rpx;
  673. border-radius: 10rpx 10rpx 10rpx 10rpx;
  674. border: 1rpx solid #E0E0E0;
  675. margin: 40rpx;
  676. padding: 22rpx;
  677. box-sizing: border-box;
  678. background: #F5F5F5;
  679. }
  680. }
  681. .check-for-img-max-box {
  682. padding: 20px 28rpx;
  683. box-sizing: border-box;
  684. background: #fff;
  685. border-bottom: 2rpx solid #E0E0E0;
  686. .left-title-p {
  687. width: 100%;
  688. text-align: left;
  689. font-size: 30rpx;
  690. font-family: PingFang SC-Medium, PingFang SC;
  691. font-weight: 400;
  692. color: #333333;
  693. line-height: 80rpx;
  694. }
  695. .right-img-box {
  696. .img-box {
  697. display inline-block;
  698. height: 150rpx;
  699. width: 150rpx;
  700. position relative;
  701. margin: 0 10rpx 20rpx 0;
  702. border-radius 10rpx;
  703. overflow hidden;
  704. .img-data {
  705. height: 150rpx;
  706. width: 150rpx;
  707. }
  708. .position-img {
  709. position absolute;
  710. right: 0;
  711. top: 0;
  712. width: 36rpx;
  713. height: 36rpx;
  714. }
  715. }
  716. .img-box:nth-of-type(4n+4) {
  717. margin-right: 0rpx;
  718. }
  719. .add-button {
  720. margin: 0 0rpx 20rpx 0;
  721. border-radius 10rpx;
  722. overflow hidden;
  723. display inline-block;
  724. height: 150rpx;
  725. width: 150rpx;
  726. }
  727. }
  728. }
  729. .list-li:last-of-type {
  730. border: none;
  731. }
  732. .hazardCheckNum{
  733. border-bottom: 2rpx solid #E0E0E0;
  734. padding: 30rpx 40rpx 34rpx 40rpx;
  735. box-sizing: border-box;
  736. background: #fff;
  737. display: flex;
  738. justify-content: flex-end;
  739. align-items: center;
  740. .hazardCheckNum-l{
  741. width: 30rpx;
  742. height: 30rpx;
  743. margin-right: 18rpx;
  744. }
  745. .hazardCheckNum-r{
  746. font-size: 28rpx;
  747. color: #FF5900;
  748. line-height: 40rpx;
  749. text-align: left;
  750. }
  751. }
  752. }
  753. .srearch {
  754. display: flex;
  755. justify-content: space-between;
  756. align-items: center;
  757. .srearch-l {
  758. font-size: 30rpx;
  759. color: #333333;
  760. line-height: 100rpx;
  761. text-align: left;
  762. }
  763. .srearch-r {
  764. width: 30rpx;
  765. height: 30rpx;
  766. margin-right: 0rpx;
  767. }
  768. }
  769. /* 语音备注 */
  770. .voice {
  771. width: 750rpx;
  772. min-height: 100rpx;
  773. background: #FFFFFF;
  774. border-radius: 20rpx 20rpx 20rpx 20rpx;
  775. overflow: hidden;
  776. .voice_t {
  777. height: 100rpx;
  778. display: flex;
  779. justify-content: space-between;
  780. align-items: center;
  781. padding: 0 30rpx;
  782. box-sizing: border-box;
  783. border-top: 2rpx solid #E0E0E0;
  784. .voice_t_t {
  785. width: 100%;
  786. display: flex;
  787. justify-content: space-between;
  788. >text:nth-of-type(1) {
  789. font-size: 30rpx;
  790. color: #333333;
  791. line-height: 100rpx;
  792. }
  793. >text:nth-of-type(2) {
  794. font-size: 28rpx;
  795. color: #999999;
  796. line-height: 100rpx;
  797. }
  798. }
  799. .voice_t_b {
  800. width: 100%;
  801. font-size: 30rpx;
  802. font-family: PingFang SC-Medium, PingFang SC;
  803. font-weight: 400;
  804. color: #333333;
  805. line-height: 100rpx;
  806. text-align: left;
  807. }
  808. }
  809. .voice_b {
  810. display flex;
  811. justify-content flex-start;
  812. align-items center;
  813. margin-bottom: 20rpx;
  814. padding: 0 30rpx;
  815. box-sizing: border-box;
  816. .voice_b_l {
  817. width: 400rpx;
  818. height: 40rpx;
  819. background: #0183FA;
  820. border-radius: 10rpx;
  821. display flex;
  822. justify-content flex-start;
  823. align-items center;
  824. font-size: 24rpx;
  825. color: #FFFFFF;
  826. line-height: 30rpx;
  827. text-align: left;
  828. >img {
  829. width: 20rpx;
  830. height: 20rpx;
  831. margin-left: 16rpx;
  832. margin-right: 20rpx;
  833. }
  834. }
  835. .voice_b_r {
  836. width: 28rpx;
  837. height: 28rpx;
  838. margin-left: 20rpx;
  839. }
  840. }
  841. .voice-btn {
  842. width: 150rpx;
  843. height: 150rpx;
  844. position: fixed;
  845. right: 24rpx;
  846. bottom: 176rpx;
  847. >img {
  848. width: 150rpx;
  849. height: 150rpx;
  850. position: absolute;
  851. }
  852. >text {
  853. font-size: 24rpx;
  854. color: #999999;
  855. line-height: 30rpx;
  856. text-align: center;
  857. position: absolute;
  858. top: 84rpx;
  859. left: 26rpx;
  860. }
  861. }
  862. }
  863. }
  864. .sub-btn {
  865. display: flex;
  866. justify-content: space-between;
  867. position: fixed;
  868. bottom: 30rpx;
  869. width: 750rpx;
  870. padding: 0 46rpx;
  871. box-sizing: border-box;
  872. >img {
  873. width: 160rpx;
  874. height: 160rpx;
  875. }
  876. }
  877. .inspectRecord{
  878. position: fixed;
  879. top: 118rpx;
  880. right: 0;
  881. z-index: 200;
  882. width: 160rpx;
  883. height: 60rpx;
  884. background: #0183FA;
  885. border-radius: 50rpx 0rpx 0rpx 50rpx;
  886. font-size: 30rpx;
  887. color: #FFFFFF;
  888. line-height: 60rpx;
  889. text-align: center;
  890. }
  891. </style>