conductInspections.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950
  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,'hazardCheckPro2',this.optionData.hazardCheckPro2);
  190. this.$set(this.newData,'hazardCheckCode2',this.optionData.hazardCheckCode2);
  191. this.$set(this.newData,'hazardCheckName2',this.optionData.hazardCheckName2);
  192. this.$set(this.newData,'hazardCheckPro3',this.optionData.hazardCheckPro3);
  193. this.$set(this.newData,'hazardCheckCode3',this.optionData.hazardCheckCode3);
  194. this.$set(this.newData,'hazardCheckName3',this.optionData.hazardCheckName3);
  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.itemsClick(item);
  249. console.log('item',item)
  250. console.log('keyPoint',keyPoint)
  251. this.$set(this.newData, 'hazardCheckPro', item.hazardCheckPro);
  252. this.$set(this.newData, 'hazardCheckCode', item.hazardCheckCode);
  253. this.$set(this.newData, 'hazardCheckName', item.hazardCheckName);
  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, 'hazardCheckPro3', item.hazardCheckPro3);
  258. this.$set(this.newData, 'hazardCheckCode3', item.hazardCheckCode3);
  259. this.$set(this.newData, 'hazardCheckName3', item.hazardCheckName3);
  260. this.$set(this.newData, 'hazardCheckPoint', item.hazardCheckPoint);
  261. this.$set(this.form, 'hazardDescribe', keyPoint);
  262. // this.$set(this.optionData, 'setOptionId', item.setOptionId);
  263. this.$set(this.optionData, 'hazardCheckPro', item.hazardCheckPro);
  264. this.$set(this, 'checkItemModuleType', false);
  265. this.securityAppCheckPhotoGetCheckNumBySub();
  266. //编辑的时候
  267. if(this.optionData.editStatus){
  268. if(this.optionData.setOptionId!=this.newData.setOptionId){
  269. this.$set(this.form, 'photoList', []);
  270. this.$set(this.form, 'voiceList', []);
  271. }
  272. }
  273. }
  274. },
  275. //提交
  276. async submitForm(status) {
  277. if (!this.form.checkFlag) {
  278. if (!this.form.hazardDescribe) {
  279. uni.showToast({
  280. title: '请填写隐患描述!',
  281. icon: "none",
  282. mask: true,
  283. duration: 2000
  284. });
  285. return
  286. }
  287. if (!this.form.photoList[0]) {
  288. uni.showToast({
  289. title: '请选择现场照片!',
  290. icon: "none",
  291. mask: true,
  292. duration: 2000
  293. });
  294. return
  295. }
  296. }
  297. let obj = {
  298. checkFlag: this.form.checkFlag,
  299. checkStatus: 1,
  300. hazardDescribe: this.form.hazardDescribe,
  301. photoList: this.form.photoList,
  302. voiceList: this.form.voiceList,
  303. manageId: this.optionData.manageId,
  304. hazardCheckPro: this.newData.hazardCheckPro,
  305. hazardCheckCode: this.newData.hazardCheckCode,
  306. hazardCheckName: this.newData.hazardCheckName,
  307. hazardCheckPro2: this.newData.hazardCheckPro2,
  308. hazardCheckCode2: this.newData.hazardCheckCode2,
  309. hazardCheckName2: this.newData.hazardCheckName2,
  310. hazardCheckPro1: this.newData.hazardCheckPro1,
  311. hazardCheckCode1: this.newData.hazardCheckCode1,
  312. hazardCheckName1: this.newData.hazardCheckName1,
  313. hazardCheckPoint: this.form.hazardDescribe,
  314. }
  315. if(this.optionData.setOptionId){
  316. obj.setOptionId = this.optionData.setOptionId;
  317. }
  318. const {
  319. data
  320. } = await securityAppCheckSetOptionCheckCommit(obj);
  321. if (data.code == 200) {
  322. uni.showToast({
  323. title: '提交成功!',
  324. icon: "none",
  325. mask: true,
  326. duration: 2000
  327. });
  328. let infoData = this.optionData;
  329. uni.redirectTo({
  330. url: '/pages_safetyCheck/views/itemsManage/hiddenDangerItemsDetail?infoData=' +
  331. encodeURIComponent(JSON
  332. .stringify(infoData))
  333. });
  334. }
  335. },
  336. //获取检查项在当前实验室出现的次数
  337. async securityAppCheckPhotoGetCheckNumBySub() {
  338. let obj = {
  339. subId: this.optionData.subId,
  340. hazardCheckPro: this.optionData.hazardCheckPro,
  341. }
  342. const {
  343. data
  344. } = await securityAppCheckPhotoGetCheckNumBySub(obj);
  345. if (data.code == 200) {
  346. this.$set(this, 'hazardCheckNum', data.data);
  347. }
  348. },
  349. //滚动事件
  350. scrollGet() {},
  351. //单选按钮
  352. radioClick(d) {
  353. let self = this;
  354. d.checked = !d.checked
  355. if (d.checked) {
  356. //如果有选中的,循环把其他选中的取消
  357. this.radioList.forEach(function(item) {
  358. if (item.id == d.id) {
  359. self.$set(self.form, 'checkFlag', item.id);
  360. } else {
  361. item.checked = false;
  362. }
  363. })
  364. } else {
  365. }
  366. },
  367. /******图片上传******/
  368. selectImage() {
  369. let self = this;
  370. let photoMaxNun = 0;
  371. if (this.form.photoList.length > 5) {
  372. uni.showToast({
  373. title: '最多上传6张图片',
  374. icon: "none",
  375. mask: true,
  376. duration: 2000
  377. });
  378. return
  379. }
  380. photoMaxNun = 6 - this.form.photoList.length;
  381. wx.chooseImage({
  382. count: photoMaxNun,
  383. sizeType: ["original", "compressed"],
  384. sourceType: ["album", "camera"],
  385. success: function(res) {
  386. if (res.tempFilePaths[0]) {
  387. res.tempFilePaths.forEach(function(item, index) {
  388. self.uploadImg(item);
  389. })
  390. }
  391. }
  392. });
  393. },
  394. async uploadImg(tempFilePaths) {
  395. var self = this;
  396. uni.showLoading({
  397. title: '上传中',
  398. mask: true
  399. });
  400. uni.uploadFile({
  401. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  402. header: {
  403. 'Authorization': uni.getStorageSync('token')
  404. },
  405. filePath: tempFilePaths,
  406. name: 'file',
  407. formData: {
  408. 'user': 'test'
  409. },
  410. success: (uploadFileRes) => {
  411. let res = JSON.parse(uploadFileRes.data);
  412. if (res.code == 200) {
  413. this.form.photoList.push({
  414. 'fileUrl': res.data.url,
  415. 'fileName': res.data.name
  416. });
  417. } else {
  418. uni.showToast({
  419. title: res.msg,
  420. icon: "none",
  421. mask: true,
  422. duration: 2000
  423. });
  424. }
  425. },
  426. fail: err => {},
  427. complete: () => {
  428. uni.hideLoading()
  429. }
  430. });
  431. },
  432. //删除图片
  433. delImg(minIndex) {
  434. this.form.photoList.splice(minIndex, 1);
  435. this.$forceUpdate();
  436. },
  437. /******语音备注 *******/
  438. //语音备忘播放
  439. async voicePlay(item) {
  440. myaudio.src = config.base_url + item;
  441. myaudio.play();
  442. },
  443. //语音备忘删除
  444. async voiceDele(item, voiceIndex) {
  445. let self = this;
  446. uni.showModal({
  447. title: '',
  448. cancelColor: '#999999',
  449. confirmColor: '#FF6E6E',
  450. content: '确定删除此语音吗?',
  451. success(res) {
  452. if (res.confirm) {
  453. console.log('用户点击确定')
  454. self.form.voiceList.splice(voiceIndex, 1);
  455. self.$forceUpdate();
  456. } else if (res.cancel) {
  457. console.log('用户点击取消')
  458. }
  459. }
  460. })
  461. },
  462. //录制
  463. recordButton(item, e) {
  464. console.log("按下")
  465. let self = this;
  466. if (this.form.voiceList.length >= 5) {
  467. uni.showToast({
  468. title: '语音备忘最多只能上传5条',
  469. icon: "none",
  470. mask: true,
  471. duration: 2000
  472. });
  473. return
  474. }
  475. this.liveType = true;
  476. console.log('录制', e)
  477. this.startPoint = e.touches[0]; //记录长按时开始点信息,后面用于计算上划取消时手指滑动的距离。
  478. const options = {
  479. duration: 60000,
  480. sampleRate: 16000,
  481. numberOfChannels: 1,
  482. encodeBitRate: 48000,
  483. format: 'mp3',
  484. frameSize: 50
  485. }
  486. this.recorderManager.start(options); //开始录音
  487. this.recorderManager.onStart(() => {
  488. console.log('recorder start')
  489. })
  490. this.recorderManager.onError((res) => {
  491. console.log(res);
  492. })
  493. wx.showToast({
  494. title: "正在录音,上划取消发送",
  495. icon: "none",
  496. duration: 60000 //先定义个60秒,后面可以手动调用wx.hideToast()隐藏
  497. });
  498. this.sendLock = false; //长按时是不上锁的。
  499. },
  500. //取消
  501. cancelButton(e) {
  502. console.log("移动")
  503. let self = this;
  504. this.liveType = false;
  505. console.log('取消', e)
  506. let moveLenght = e.touches[e.touches.length - 1].clientY - this.startPoint.clientY; //移动距离
  507. if (Math.abs(moveLenght) > 50) {
  508. wx.showToast({
  509. title: "松开手指,取消发送",
  510. icon: "none",
  511. duration: 60000
  512. });
  513. this.sendLock = true; //触发了上滑取消发送,上锁
  514. } else {
  515. wx.showToast({
  516. title: "正在录音,上划取消发送",
  517. icon: "none",
  518. duration: 60000
  519. });
  520. this.sendLock = false; //上划距离不足,依然可以发送,不上锁
  521. }
  522. },
  523. //发送
  524. sendButton(item, e) {
  525. console.log("松开")
  526. let self = this;
  527. this.liveType = false;
  528. console.log('发送', e)
  529. wx.hideToast(); //结束录音、隐藏Toast提示框
  530. this.recorderManager.stop(); //结束录音
  531. this.recorderManager.onStop((res) => {
  532. if (!this.sendLock) {
  533. this.uploadVoice(item, res.duration, res.tempFilePath);
  534. }
  535. console.log('停止录音', res.tempFilePath)
  536. console.log("sendLock", this.sendLock);
  537. })
  538. },
  539. //上传MP3
  540. async uploadVoice(item, times, tempFilePaths) {
  541. var self = this;
  542. uni.uploadFile({
  543. url: config.base_url + '/system/file/upload', //仅为示例,非真实的接口地址
  544. header: {
  545. 'Authorization': uni.getStorageSync('token')
  546. },
  547. filePath: tempFilePaths,
  548. name: 'file',
  549. formData: {
  550. 'user': 'test'
  551. },
  552. success: (uploadFileRes) => {
  553. let res = JSON.parse(uploadFileRes.data);
  554. if (res.code == 200) {
  555. console.log("上传成功", res)
  556. console.log(item)
  557. let seconds = Math.round((parseInt(times) % (1000 * 60)) / 1000);
  558. this.form.voiceList.push({
  559. 'fileLength': seconds,
  560. 'fileUrl': res.data.url,
  561. 'fileName': res.data.name
  562. })
  563. console.log(JSON.stringify(self.voice))
  564. //self.textParseUrlIps(res.data.url);
  565. // self.newData.imgList.push(res.data.url);
  566. } else {
  567. uni.showToast({
  568. title: res.msg,
  569. icon: "none",
  570. mask: true,
  571. duration: 2000
  572. });
  573. }
  574. },
  575. fail: err => {
  576. uni.hideLoading()
  577. },
  578. complete: () => {}
  579. });
  580. },
  581. }
  582. }
  583. </script>
  584. <style lang="stylus" scoped>
  585. .inspectAdd {
  586. height: 100%;
  587. display flex;
  588. box-sizing: border-box;
  589. padding-bottom: 230rpx;
  590. box-sizing: border-box;
  591. .tip {
  592. width: 750rpx;
  593. height: 80rpx;
  594. background: rgba(1, 131, 250, 0.2);
  595. font-weight: normal;
  596. font-size: 28rpx;
  597. color: #0183FA;
  598. line-height: 80rpx;
  599. text-align: center;
  600. }
  601. .list {
  602. width: 750rpx;
  603. margin: 20rpx 0rpx 0;
  604. border-radius: 20rpx 20rpx 20rpx 20rpx;
  605. overflow: hidden;
  606. .list-li {
  607. display: flex;
  608. justify-content: space-between;
  609. align-items: center;
  610. padding: 0 30rpx;
  611. box-sizing: border-box;
  612. border-bottom: 1rpx solid #E0E0E0;
  613. background: #fff;
  614. >view:nth-of-type(1) {
  615. font-size: 30rpx;
  616. color: #333333;
  617. line-height: 100rpx;
  618. text-align: left;
  619. overflow: hidden;
  620. text-overflow: ellipsis;
  621. white-space: nowrap;
  622. }
  623. >view:nth-of-type(2) {
  624. font-size: 28rpx;
  625. color: #666666;
  626. line-height: 100rpx;
  627. text-align: left;
  628. display: flex;
  629. justify-content: space-between;
  630. align-items: center;
  631. >img {
  632. width: 30rpx;
  633. height: 30rpx;
  634. margin-left: 10rpx;
  635. }
  636. }
  637. }
  638. .hidden-content {
  639. width: 630rpx;
  640. min-height: 200rpx;
  641. background: #F5F5F5;
  642. border-radius: 20rpx 20rpx 20rpx 20rpx;
  643. margin: 20rpx 30rpx 0;
  644. padding: 20rpx;
  645. box-sizing: border-box;
  646. font-size: 28rpx;
  647. color: #666666;
  648. line-height: 39rpx;
  649. text-align: left;
  650. }
  651. .photo {
  652. display: flex;
  653. justify-content: flex-start;
  654. flex-wrap: wrap;
  655. margin-top: 20rpx;
  656. padding: 0 30rpx;
  657. box-sizing: border-box;
  658. >img {
  659. width: 150rpx;
  660. height: 150rpx;
  661. border-radius: 10rpx 10rpx 10rpx 10rpx;
  662. margin: 0 10rpx 10rpx 0;
  663. }
  664. >img:nth-of-type(4) {
  665. margin-right: 0;
  666. }
  667. }
  668. .describe {
  669. width: 750rpx;
  670. background: #fff;
  671. overflow: hidden;
  672. .describe-n {
  673. width: 690rpx;
  674. min-height: 180rpx;
  675. border-radius: 10rpx 10rpx 10rpx 10rpx;
  676. border: 1rpx solid #E0E0E0;
  677. margin: 40rpx;
  678. padding: 22rpx;
  679. box-sizing: border-box;
  680. background: #F5F5F5;
  681. }
  682. }
  683. .check-for-img-max-box {
  684. padding: 20px 28rpx;
  685. box-sizing: border-box;
  686. background: #fff;
  687. border-bottom: 2rpx solid #E0E0E0;
  688. .left-title-p {
  689. width: 100%;
  690. text-align: left;
  691. font-size: 30rpx;
  692. font-family: PingFang SC-Medium, PingFang SC;
  693. font-weight: 400;
  694. color: #333333;
  695. line-height: 80rpx;
  696. }
  697. .right-img-box {
  698. .img-box {
  699. display inline-block;
  700. height: 150rpx;
  701. width: 150rpx;
  702. position relative;
  703. margin: 0 10rpx 20rpx 0;
  704. border-radius 10rpx;
  705. overflow hidden;
  706. .img-data {
  707. height: 150rpx;
  708. width: 150rpx;
  709. }
  710. .position-img {
  711. position absolute;
  712. right: 0;
  713. top: 0;
  714. width: 36rpx;
  715. height: 36rpx;
  716. }
  717. }
  718. .img-box:nth-of-type(4n+4) {
  719. margin-right: 0rpx;
  720. }
  721. .add-button {
  722. margin: 0 0rpx 20rpx 0;
  723. border-radius 10rpx;
  724. overflow hidden;
  725. display inline-block;
  726. height: 150rpx;
  727. width: 150rpx;
  728. }
  729. }
  730. }
  731. .list-li:last-of-type {
  732. border: none;
  733. }
  734. .hazardCheckNum{
  735. border-bottom: 2rpx solid #E0E0E0;
  736. padding: 30rpx 40rpx 34rpx 40rpx;
  737. box-sizing: border-box;
  738. background: #fff;
  739. display: flex;
  740. justify-content: flex-end;
  741. align-items: center;
  742. .hazardCheckNum-l{
  743. width: 30rpx;
  744. height: 30rpx;
  745. margin-right: 18rpx;
  746. }
  747. .hazardCheckNum-r{
  748. font-size: 28rpx;
  749. color: #FF5900;
  750. line-height: 40rpx;
  751. text-align: left;
  752. }
  753. }
  754. }
  755. .srearch {
  756. display: flex;
  757. justify-content: space-between;
  758. align-items: center;
  759. .srearch-l {
  760. font-size: 30rpx;
  761. color: #333333;
  762. line-height: 100rpx;
  763. text-align: left;
  764. }
  765. .srearch-r {
  766. width: 30rpx;
  767. height: 30rpx;
  768. margin-right: 0rpx;
  769. }
  770. }
  771. /* 语音备注 */
  772. .voice {
  773. width: 750rpx;
  774. min-height: 100rpx;
  775. background: #FFFFFF;
  776. border-radius: 20rpx 20rpx 20rpx 20rpx;
  777. overflow: hidden;
  778. .voice_t {
  779. height: 100rpx;
  780. display: flex;
  781. justify-content: space-between;
  782. align-items: center;
  783. padding: 0 30rpx;
  784. box-sizing: border-box;
  785. border-top: 2rpx solid #E0E0E0;
  786. .voice_t_t {
  787. width: 100%;
  788. display: flex;
  789. justify-content: space-between;
  790. >text:nth-of-type(1) {
  791. font-size: 30rpx;
  792. color: #333333;
  793. line-height: 100rpx;
  794. }
  795. >text:nth-of-type(2) {
  796. font-size: 28rpx;
  797. color: #999999;
  798. line-height: 100rpx;
  799. }
  800. }
  801. .voice_t_b {
  802. width: 100%;
  803. font-size: 30rpx;
  804. font-family: PingFang SC-Medium, PingFang SC;
  805. font-weight: 400;
  806. color: #333333;
  807. line-height: 100rpx;
  808. text-align: left;
  809. }
  810. }
  811. .voice_b {
  812. display flex;
  813. justify-content flex-start;
  814. align-items center;
  815. margin-bottom: 20rpx;
  816. padding: 0 30rpx;
  817. box-sizing: border-box;
  818. .voice_b_l {
  819. width: 400rpx;
  820. height: 40rpx;
  821. background: #0183FA;
  822. border-radius: 10rpx;
  823. display flex;
  824. justify-content flex-start;
  825. align-items center;
  826. font-size: 24rpx;
  827. color: #FFFFFF;
  828. line-height: 30rpx;
  829. text-align: left;
  830. >img {
  831. width: 20rpx;
  832. height: 20rpx;
  833. margin-left: 16rpx;
  834. margin-right: 20rpx;
  835. }
  836. }
  837. .voice_b_r {
  838. width: 28rpx;
  839. height: 28rpx;
  840. margin-left: 20rpx;
  841. }
  842. }
  843. .voice-btn {
  844. width: 150rpx;
  845. height: 150rpx;
  846. position: fixed;
  847. right: 24rpx;
  848. bottom: 176rpx;
  849. >img {
  850. width: 150rpx;
  851. height: 150rpx;
  852. position: absolute;
  853. }
  854. >text {
  855. font-size: 24rpx;
  856. color: #999999;
  857. line-height: 30rpx;
  858. text-align: center;
  859. position: absolute;
  860. top: 84rpx;
  861. left: 26rpx;
  862. }
  863. }
  864. }
  865. }
  866. .sub-btn {
  867. display: flex;
  868. justify-content: space-between;
  869. position: fixed;
  870. bottom: 30rpx;
  871. width: 750rpx;
  872. padding: 0 46rpx;
  873. box-sizing: border-box;
  874. >img {
  875. width: 160rpx;
  876. height: 160rpx;
  877. }
  878. }
  879. .inspectRecord{
  880. position: fixed;
  881. top: 118rpx;
  882. right: 0;
  883. z-index: 200;
  884. width: 160rpx;
  885. height: 60rpx;
  886. background: #0183FA;
  887. border-radius: 50rpx 0rpx 0rpx 50rpx;
  888. font-size: 30rpx;
  889. color: #FFFFFF;
  890. line-height: 60rpx;
  891. text-align: center;
  892. }
  893. </style>