check_implement.vue 43 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334
  1. <template>
  2. <view>
  3. <view>
  4. <!-- 数据类型为消防设备 --比如一个灭火器 -->
  5. <u-list height="87vh" @scrolltolower="scrolltolower" v-if="!getqrcode">
  6. <u-list-item @click="goDetail" v-for="(item, index) in tableData" :key="index">
  7. <view>
  8. <view class="titles">{{item.inspName}}:{{item.inspContent}}</view>
  9. <!-- 消防设备 -->
  10. <view v-if="item.inspType=='fpd'">
  11. <view style="display: flex;flex-direction: column;margin-left: 40rpx;">
  12. <image :src="scan" class="tupian" @click="erWeiMa(item.id,index)"
  13. style="margin-left: 25rpx;"></image>
  14. <view style="margin-top: 20rpx;">扫二维码</view>
  15. <!-- <view>扫码结果 :{{qrcodeResault}}</view> -->
  16. </view>
  17. <!-- #ifdef H5 -->
  18. <view class="qrcode" v-if="item.qrcodeShow">
  19. <qrcode-stream @decode="onDecode" />
  20. </view>
  21. <!-- #endif -->
  22. </view>
  23. <!-- 数据类型不为消防设备 -->
  24. <uni-grid :column="3" :showBorder="false" v-else>
  25. <!-- <view v-if="item.inspType!='fpd'"> -->
  26. <uni-grid-item v-for="(items,indexs) in item.inspectResultList" :key="indexs">
  27. <!-- 不是消防设施 -->
  28. <view class="grid-item-box">
  29. <image :src="items.subValue==1?zhengchang:moren" class="tupian"
  30. @click="normal(items,indexs,index,item)">
  31. </image>
  32. <text class="text">{{items.subLable}}</text>
  33. </view>
  34. <!-- 是消防设施,点击事件只是弹框 -->
  35. <!-- <view class="grid-item-box" v-else>
  36. <image :src="items.subValue==1?zhengchang:hidden" class="tupian" @click="noNormal">
  37. </image>
  38. <text class="text">{{items.subLable}}</text>
  39. </view> -->
  40. </uni-grid-item>
  41. <!-- </view> -->
  42. <uni-grid-item>
  43. <view class="grid-item-box" @click="photoUpload(item,index)">
  44. <image :src="photograph" class="tupian"></image>
  45. <!-- -->
  46. <uni-load-more v-if="item.loading" status="loading" :content-text="contentText" />
  47. <text v-else class="text">拍照上传</text>
  48. </view>
  49. </uni-grid-item>
  50. </uni-grid>
  51. <!-- 线 -->
  52. <!-- <view style="width: 80%;height: 2rpx;background-color: #f8f8f8;margin-left: 10%;"></view> -->
  53. <!-- v-if="item.attUrl!=[] -->
  54. <view class="uni-grid-wrap" v-if="item.attUrl.length!=0">
  55. <view style="color: #8C8C8C;">设备图片</view>
  56. <view style="position: relative;width: 180rpx;float: left;margin: 40rpx;"
  57. v-for="(items,indexs) in item.attUrl" :key="indexs">
  58. <image :src="items"
  59. style="width: 160rpx;height: 160rpx;border-radius: 30rpx;float: left;">
  60. </image>
  61. <u-icon name="close" color="#4CB2B6" size="19" @click="closeImage(item,indexs,index)">
  62. </u-icon>
  63. </view>
  64. </view>
  65. </view>
  66. <view class="slot-contents" v-if="item.showDescription&&item.inspType!='fpd'"
  67. @click="descript(index)">
  68. <textarea v-model="item.description" placeholder="请选择或隐患描述内容"
  69. @click="clickChoiceDanger(index)"></textarea>
  70. <!-- ----隐患 -->
  71. <u-popup :show="item.showDanger" :round="10" @close="item.showDanger=false">
  72. <view style="width: 90vw;overflow-y: auto;margin-bottom: 80rpx;padding:10px">
  73. <text class="text-xl">选择隐患类型:</text>
  74. <view class="" class="person-forward">
  75. <u-checkbox-group v-for="(items, indexs) in item.choiceDanger" :key="indexs"
  76. placement="column" v-model="items.checkedListDanger"
  77. @change="checkboxChange2(items.name,$event)" activeColor="#4CB2B6"
  78. iconSize="red">
  79. <u-checkbox :customStyle="{marginBottom: '60rpx'}" :label="items.name"
  80. :name="items.name">
  81. </u-checkbox>
  82. </u-checkbox-group>
  83. </view>
  84. <view class="flex flex-direction-row "
  85. style="position: fixed;bottom: 10px;left: 50%;transform: translate(-50%);height: 100rpx;width: 80%">
  86. <u-button shape="circle" type="primary" color="#4CB2B6" text="确定"
  87. @click="checkboxConfirm2(index)" customStyle="margin-right:20px;padding:0 30px">
  88. </u-button>
  89. <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
  90. @click="checkboxCancel2(index)" customStyle="padding:0 30px">
  91. </u-button>
  92. </view>
  93. </view>
  94. </u-popup>
  95. <!-- ----隐患 -->
  96. </view>
  97. <!-- <u-modal :show="show2" title="隐患描述" @confirm="descript(index)" @cancel="show2 = false">
  98. <view class="slot-content">
  99. <textarea v-model="description" placeholder="请输入描述内容" />
  100. </view>
  101. </u-modal> -->
  102. <!-- 扫码点击确定后每个设备的信息push到了新的数组里,显示在扫一扫下方的数据-->
  103. <view v-for="(items, indexs) in item.hisFpdCreateReqVOList" :key="indexs" class="child"
  104. style="background-color: aliceblue;">
  105. <view>
  106. <view class="child-new">
  107. <view class="child-new-item">
  108. <u-avatar shape="square" size="80" :src="items.attUrl[0]"
  109. customStyle="margin: -3px 5px -3px 20rpx"></u-avatar>
  110. </view>
  111. <view style="flex:1">
  112. <view>
  113. <view style="margin:40rpx 0 0 40rpx;">设备序列号:{{items.fpdCode}}
  114. </view>
  115. </view>
  116. <view class="child-result">
  117. <uni-grid :column="3" :showBorder="false">
  118. <uni-grid-item v-for="(items2,indexs2) in items.inspectResultList"
  119. :key="indexs2">
  120. <!-- 是消防设施,点击事件只是弹框 -->
  121. <view class="grid-item-box">
  122. <image :src="items2.subValue==1?zhengchang:hidden" class="tupian2"
  123. @click="noNormal">
  124. </image>
  125. <text class="text2">{{items2.subLable}}</text>
  126. </view>
  127. </uni-grid-item>
  128. </uni-grid>
  129. </view>
  130. </view>
  131. </view>
  132. <!-- popup拍照的数据 -->
  133. <!-- <view class="uni-grid-wraps" style="padding-bottom: 20rpx;">
  134. <view style="position: relative;width: 180rpx;float: left;"
  135. v-for="(items3,indexs3) in items.attUrl" :key="indexs3">
  136. <image :src="items3"
  137. style="width: 120rpx;height: 120rpx;border-radius: 30rpx;float: left;margin:0 20rpx 20rpx 0;">
  138. <u-icon name="close" color="#4CB2B6" size="19" @click="closeImage(indexs,index)">
  139. </u-icon>
  140. </view>
  141. </view> -->
  142. <!---->
  143. </view>
  144. </view>
  145. </u-list-item>
  146. </u-list>
  147. </view>
  148. <view
  149. style="width: 60%;position: fixed;bottom:10rpx;z-index: 9999;left: 50%;transform: translate(-50%);height: 6vh;"
  150. v-if="!getqrcode">
  151. <div class="btnList" v-if="tableData.length!=0">
  152. <u-button shape="circle" type="primary" color="#4CB2B6" text="暂存" customStyle="margin-right:20%"
  153. @click="checkImplementConfirm">
  154. <!-- 立即处理改为暂存了 -->
  155. </u-button>
  156. <u-button shape="circle" type="primary" color="#4CB2B6" text="完成任务" @click="checkImplementRelease">
  157. </u-button>
  158. </div>
  159. </view>
  160. <!-- <view style="text-align: center;" v-if="tableData.length==0&&!getqrcode">
  161. <view class="text-gray" style="padding-top: 20px;font-size: 40rpx;"> 暂无任务 </view>
  162. </view> -->
  163. <!-- //"show巡查未完成判断--可能需要打开 -->
  164. <u-modal :show="show" :title="title" :content='content' @confirm="show = false"></u-modal>
  165. <u-modal :show="show3" :title="title" content='未完成有问题检查项拍照' @confirm="show3= false"></u-modal>
  166. <u-modal :show="show4" :title="title" content='未对消防设备进行扫码检查' @confirm="show4= false"></u-modal>
  167. <!-- 弹出层 -->
  168. <u-popup :show="maShow" :round="10">
  169. <view v-if="insTypeData!=''">
  170. <view class="springFarm" v-for="(item,index) in insTypeData" :key="index">
  171. <view class="show-title">设备名称:{{item.fpdName}}</view>
  172. <view class="show-title">设备序列号:{{item.fpdCode}}</view>
  173. <view>
  174. <view class="show-title">设备检查项:</view>
  175. </view>
  176. <view class="" v-if="item.inspectResultList!=''">
  177. <uni-grid :column="3" :showBorder="false">
  178. <uni-grid-item v-for="(items,indexs) in item.inspectResultList" :key="indexs">
  179. <view class="grid-item-box">
  180. <image :src="items.subValue==1?zhengchang:moren" class="tupian"
  181. @click="normalPopup(items,indexs,index)">
  182. </image>
  183. <text class="text">{{items.subLable}}</text>
  184. </view>
  185. </uni-grid-item>
  186. </uni-grid>
  187. </view>
  188. <!-- ----扫码选择隐患 -->
  189. <view class="slot-contents" v-if="show5">
  190. <textarea v-model="description2" placeholder="请输入描述内容" @click="popupChoiceDangerFpd"></textarea>
  191. <u-popup :show="showPopupDanger" :round="10" @close="showPopupDanger=false">
  192. <view style="width: 90vw;overflow-y: auto;margin-bottom: 80rpx;padding:10px">
  193. <text class="text-xl">选择隐患类型:</text>
  194. <view class="" class="person-forward">
  195. <u-checkbox-group v-for="(items, indexs) in choiceDanger" :key="indexs"
  196. placement="column" v-model="items.checkedListDanger"
  197. @change="checkboxChange3(items.name,$event)" activeColor="#4CB2B6"
  198. iconSize="red">
  199. <u-checkbox :customStyle="{marginBottom: '60rpx'}" :label="items.name"
  200. :name="items.name">
  201. </u-checkbox>
  202. </u-checkbox-group>
  203. </view>
  204. <view class="flex flex-direction-row "
  205. style="position: fixed;bottom: 10px;left: 50%;transform: translate(-50%);height: 100rpx;width: 80%">
  206. <u-button shape="circle" type="primary" color="#4CB2B6" text="确定"
  207. @click="checkboxConfirm3()" customStyle="margin-right:20px;padding:0 30px">
  208. </u-button>
  209. <u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
  210. @click="checkboxCancel3()" customStyle="padding:0 30px">
  211. </u-button>
  212. </view>
  213. </view>
  214. </u-popup>
  215. </view>
  216. <!-- ----扫码选择隐患 -->
  217. <view class="show-title">
  218. <view class="">巡检拍照:<text style="color:#822e2e;"></text></view>
  219. <view class="">
  220. <image :src="photograph" @click="photoUpload(item,index)" class="tiantupian"></image>
  221. <!-- 加载中 -->
  222. <!-- <isLodingModel></isLodingModel> -->
  223. </view>
  224. <uni-load-more v-show="item.loading" status="loading" :content-text="contentText" />
  225. </view>
  226. <view class="uni-grid-wraps">
  227. <view style="position: relative;width: 180rpx;float: left;margin: 10rpx 15rpx 0 0rpx;"
  228. v-for="(items,indexs) in item.attUrl" :key="indexs">
  229. <image :src="items" style="width: 160rpx;height: 160rpx;border-radius: 30rpx;float: left;">
  230. <u-icon name="close" color="#4CB2B6" size="19" @click="closeImage(item,indexs,index)">
  231. </u-icon>
  232. </view>
  233. </view>
  234. <view style="width: 60%;position: fixed;left:150rpx;;bottom:60rpx;z-index: 9999;">
  235. <div class="btnList" v-if="tableData.length!=0">
  236. <u-button shape="circle" type="primary" color="#4CB2B6" text="保存"
  237. customStyle="margin-right:20%" @click="checkPopupConfirm(item.id)">
  238. </u-button>
  239. <u-button shape="circle" type="primary" color="#4CB2B6" text="取消" @click="checkPopupCancel">
  240. </u-button>
  241. </div>
  242. </view>
  243. </view>
  244. </view>
  245. <view v-else>
  246. <view class="" style="text-align: center;margin-top: 30px;">
  247. 暂无数据
  248. </view>
  249. <view style="width: 60%;position: absolute;left:150rpx;;bottom:60rpx;z-index: 9999;">
  250. <div class="btnList" v-if="tableData.length!=0">
  251. <u-button shape="circle" type="primary" color="#4CB2B6" text="保存" customStyle="margin-right:20%"
  252. @click="checkPopupConfirm(item.id)">
  253. </u-button>
  254. <u-button shape="circle" type="primary" color="#4CB2B6" text="取消" @click="checkPopupCancel">
  255. </u-button>
  256. </div>
  257. </view>
  258. </view>
  259. </u-popup>
  260. <!-- <u-modal :show="show5" title="隐患描述" @confirm="descriptFpd" @cancel="show5 = false">
  261. <view class="slot-content shebeidesrip">
  262. <textarea v-model="description2" placeholder="请输入描述内容" />
  263. </view>
  264. </u-modal> -->
  265. <!-- 多选closeable closeOnClickOverlay--点击遮罩层不可关闭所属部门的弹出内容选中 ,选择部门-->
  266. </view>
  267. </template>
  268. <script>
  269. let that = null
  270. // #ifdef H5
  271. import {
  272. QrcodeStream
  273. } from 'vue-qrcode-reader'
  274. // #endif
  275. import {
  276. CheckActiveImplement, //每日巡查扫码界面
  277. saveCheckImplement, //保存检查项
  278. checkSubmitRelease, //提交发布检查下
  279. inspTypeList //二维码的弹框数据
  280. } from "@/api/check_active";
  281. import {
  282. getAccessToken
  283. } from '@/utils/auth'
  284. import config from '@/config'
  285. import store from "@/store"
  286. import loadImage from 'blueimp-load-image';
  287. const baseUrl = config.baseUrl
  288. const baseUrlImg = config.baseUrlImg
  289. //隐患弹框--
  290. import {
  291. DICT_TYPE,
  292. getDictDatas
  293. } from '@/utils/dict';
  294. //隐患弹框--
  295. export default {
  296. components: {
  297. // #ifdef H5
  298. QrcodeStream
  299. // #endif
  300. },
  301. data() {
  302. return {
  303. contentText: {
  304. contentrefresh: '上传照片中',
  305. },
  306. // ----隐患
  307. choiceDanger: getDictDatas(DICT_TYPE.DANGER_TYPE),
  308. checkedDanger: [],
  309. checkedListDanger: [], //选择的隐患数据
  310. DangerIndex: "", //隐患描述的位置下标
  311. // ----隐患
  312. // ----扫码选择隐患
  313. showPopupDanger: false,
  314. checkedPopupDanger: [], //
  315. // ----扫码选择隐患
  316. insType: 1, //1代表检查类型为消防设施,显示扫一扫按钮,其他则显示拍照
  317. // danger: danger, //有隐患图片
  318. moren: `${baseUrlImg}/checkActive/moren.png`, //默认图片
  319. zhengchang: `${baseUrlImg}/checkActive/zhengchang.png`,
  320. hidden: `${baseUrlImg}/checkActive/hidden.png`,
  321. photograph: `${baseUrlImg}/checkActive/photograph.png`,
  322. scan: `${baseUrlImg}/checkActive/scan.png`,
  323. tableData: [],
  324. maShow: false, //扫码后弹框是否展示
  325. // 每页数据量
  326. // 当前页
  327. // 数据总量
  328. total: 0,
  329. getqrcode: false,
  330. loading: false,
  331. formData: {
  332. id: 0,
  333. pageNo: 1,
  334. pageSize: 10,
  335. status: 0,
  336. taskStatus: 1,
  337. broadId: 0,
  338. },
  339. saveImplement: {
  340. inspectList: [],
  341. inspectTime: "", //传的当前事件
  342. orgId: 0,
  343. taskId: 0, //待完成列表所点击的id
  344. broadId: 0,
  345. description: ''
  346. },
  347. isZhengChang: false, //是否正常
  348. isYinHuan: false, //是否隐患
  349. show: false, //未巡查提示框
  350. show2: false, //隐患描述提示框
  351. show3: false, //未拍照提示框
  352. show4: false, //未巡查扫码提示框
  353. show5: false, //检查设备隐患描述提示框
  354. title: '注意',
  355. content: '巡查未完成',
  356. contents: '',
  357. description: '', //隐患描述内容
  358. description2: '', //检查设备的描述内容
  359. newtableDatas: [], //缓存的数据,防止覆盖
  360. id: '',
  361. FinalTime: '',
  362. Insdengers: '', //每个列的检查项是否勾选
  363. nnorNormalValue: '',
  364. erWeiMaShu: '', //二维码内容对象
  365. insTypeData: '', //扫二维码后出现的消防列表数据内容
  366. newInsTypeData: [], //点击扫码后的设备内容
  367. confirminsTypeData: [], //点击确定新建一个新的数组
  368. checkTableDataId: 0, //扫码所点击的当前检查设施的id
  369. descriptIndex: '', //描述所在id
  370. yilou: false, //如果显示了有遗漏的检查项就不提示还未拍照
  371. type: '',
  372. selectedIndex: '',
  373. qrcodeShow: false,
  374. qrcodeResault: '等待扫码...',
  375. onDecodeIndex: '',
  376. submitButton: '完成任务',
  377. }
  378. },
  379. watch: {
  380. loading: {
  381. handler(newLength, oldLength) {
  382. this.$modal.isLoadingModel(this.loading)
  383. },
  384. immediate: true
  385. }
  386. },
  387. // 在 vue页面,向起始页通过事件传递数据
  388. onLoad: function(option) {
  389. this.choiceDanger.map(i => {
  390. i.name = i.label;
  391. i.id = i.value;
  392. });
  393. this.type = option.type ? option.type : ''
  394. that = this;
  395. const eventChannel = this.getOpenerEventChannel();
  396. eventChannel.on('acceptDataFromOpenerPage', function(val) {
  397. // that.formData = val
  398. that.options = val.taskInfo ? val.taskInfo : val
  399. that.formData.id = parseInt(that.options.id)
  400. that.contents = that.options.taskContent
  401. that.formData.broadId = parseInt(option.broadId)
  402. that.saveImplement.broadId = parseInt(option.broadId)
  403. that.saveImplement.orgId = parseInt(that.options.orgId)
  404. that.newtableDatas.push(uni.getStorageSync('tableData'))
  405. if (that.newtableDatas && that.newtableDatas[0][option.broadId]) { //获取本地缓存的数据
  406. that.tableData = that.newtableDatas[0][option.broadId]
  407. that.tableData.map(i => i.choiceDanger = that.choiceDanger)
  408. that.insTypeData = uni.getStorageSync('insTypeData')
  409. } else {
  410. that.tableData = []
  411. that.getData(that.formData.pageNo)
  412. }
  413. })
  414. },
  415. onShow() {},
  416. methods: {
  417. // ----隐患
  418. checkboxConfirm2(index) {
  419. this.choiceDanger.map(i => {
  420. if (i.name == this.checkedListDanger[this.checkedListDanger.length - 1]) {
  421. this.tableData[index].dengerType = i.value
  422. }
  423. });
  424. this.tableData[index].description = this.checkedListDanger.toString()
  425. if (this.tableData[index].description.startsWith(',')) {
  426. this.tableData[index].description = this.tableData[index].description.slice(1);
  427. }
  428. this.tableData[index].showDanger = false
  429. this.$forceUpdate()
  430. },
  431. checkboxCancel2(index) {
  432. this.tableData[index].showDanger = false
  433. this.checkedListDanger = []
  434. this.$forceUpdate()
  435. },
  436. clickChoiceDanger(index) { //描述框点击事件
  437. this.checkedListDanger = this.tableData[index].description.split(',')
  438. if (this.checkedListDanger.includes('其他')) {
  439. this.tableData[index].showDanger = false
  440. } else {
  441. this.tableData[index].showDanger = true
  442. this.DangerIndex = index
  443. this.$forceUpdate()
  444. }
  445. this.tableData[index].choiceDanger.map((i, indexs) => { //选中的回显
  446. i.checkedListDanger = []
  447. this.checkedListDanger.map(v => {
  448. if (i.name == v) {
  449. this.tableData[index].choiceDanger[indexs].checkedListDanger.push(v)
  450. }
  451. })
  452. })
  453. },
  454. checkboxChange2(i, n) { //勾选的事件
  455. if (i && n.length != 0) {
  456. this.checkedListDanger.push(i)
  457. } else if (i && n.length == 0) {
  458. this.checkedListDanger = this.checkedListDanger.filter(item => item != i)
  459. }
  460. },
  461. // ----隐患
  462. // ----扫码选择隐患
  463. popupChoiceDangerFpd() {
  464. this.checkedPopupDanger = this.description2.split(',')
  465. if (this.checkedPopupDanger.includes('其他')) {
  466. this.showPopupDanger = false
  467. } else {
  468. this.showPopupDanger = true
  469. this.$forceUpdate()
  470. }
  471. this.choiceDanger.map((i, indexs) => { //选中的回显
  472. i.checkedListDanger = []
  473. this.checkedPopupDanger.map(v => {
  474. if (i.name == v) {
  475. this.choiceDanger[indexs].checkedListDanger.push(v)
  476. }
  477. })
  478. })
  479. },
  480. checkboxConfirm3(index) {
  481. this.choiceDanger.map(i => {
  482. if (i.name == this.checkedPopupDanger[this.checkedPopupDanger.length - 1]) {
  483. this.insTypeData[0].dengerType = i.value
  484. }
  485. });
  486. console.log(this.insTypeData[0].dengerType,'this.insTypeData[0].dengerType');
  487. this.description2 = this.checkedPopupDanger.toString()
  488. if (this.description2.startsWith(',')) {
  489. this.description2 = this.description2.slice(1);
  490. }
  491. this.showPopupDanger = false
  492. this.$forceUpdate()
  493. },
  494. checkboxCancel3(index) {
  495. this.showPopupDanger = false
  496. this.checkedPopupDanger = []
  497. this.$forceUpdate()
  498. },
  499. checkboxChange3(i, n) { //勾选的事件
  500. if (i && n.length != 0) {
  501. this.checkedPopupDanger.push(i)
  502. } else if (i && n.length == 0) {
  503. this.checkedPopupDanger = this.checkedPopupDanger.filter(item => item != i)
  504. }
  505. },
  506. // ----扫码选择隐患
  507. //扫码
  508. erWeiMa(checkTableDataIds, index) {
  509. // #ifdef H5
  510. this.tableData[index].qrcodeShow = true
  511. this.$forceUpdate()
  512. this.onDecodeIndex = index
  513. this.checkTableDataId = checkTableDataIds
  514. // #endif
  515. // #ifdef MP-WEIXIN
  516. var that = this
  517. this.description = ''
  518. // 只允许从相机扫码
  519. uni.scanCode({
  520. onlyFromCamera: true, //只允许从相机扫码
  521. success: function(res) {
  522. if (res.errMsg == "scanCode:ok") {
  523. let result = JSON.parse(res.result)
  524. if (that.tableData[index].hisFpdCreateReqVOList.length > 0) {
  525. var temp = that.tableData[index].hisFpdCreateReqVOList
  526. // console.log(temp);
  527. temp = temp.filter(i => i.id == result.id)
  528. if (temp.length > 0) {
  529. this.tableData[this.onDecodeIndex].qrcodeShow = false
  530. return that.$modal.alert('该设备已检查')
  531. }
  532. }
  533. //调接口,会传过来id标识,失败显示错误信息,比如该设备不存在,成功的花弹出扫码成功
  534. inspTypeList(JSON.parse(res.result)).then(reponse => {
  535. if (reponse.code == 0) {
  536. that.maShow = true
  537. that.insTypeData = reponse.data.records
  538. that.insTypeData.map(i => {})
  539. }
  540. })
  541. setTimeout(() => {
  542. that.$modal.msgSuccess('扫码成功')
  543. }, 200)
  544. that.checkTableDataId = checkTableDataIds
  545. }
  546. },
  547. fail: (err) => {
  548. that.$modal.msgError('未识别到二维码,请重新尝试!')
  549. }
  550. })
  551. // #endif
  552. },
  553. // #ifdef H5
  554. // H5相机相关函数
  555. onDecode(qrcodeVal) {
  556. try {
  557. let result = JSON.parse(qrcodeVal);
  558. } catch (error) {
  559. return this.$modal.alert('无法解析二维码内容');
  560. }
  561. this.qrcodeResault = qrcodeVal
  562. let result = JSON.parse(qrcodeVal)
  563. this.tableData[this.onDecodeIndex].qrcodeShow = false
  564. var that = this
  565. if (that.tableData[this.onDecodeIndex].hisFpdCreateReqVOList.length > 0) {
  566. var temp = that.tableData[this.onDecodeIndex].hisFpdCreateReqVOList
  567. temp = temp.filter(i => i.id == result.id)
  568. if (temp.length > 0) return that.$modal.alert('该设备已检查')
  569. }
  570. //调接口,会传过来id标识,失败显示错误信息,比如该设备不存在,成功的花弹出扫码成功
  571. inspTypeList(JSON.parse(qrcodeVal)).then(reponse => {
  572. if (reponse.code == 0) {
  573. that.maShow = true
  574. that.insTypeData = reponse.data.records
  575. that.insTypeData.map(i => i.attUrl = [])
  576. }
  577. })
  578. },
  579. onInit(promise) { //未使用
  580. promise
  581. .then(console.log)
  582. .catch(console.error)
  583. },
  584. // #endif
  585. descript(index) { //隐患描述点击确认
  586. // this.show2 = false
  587. // this.tableData[index].description = this.description
  588. },
  589. descriptFpd() { //隐患描述点击确认
  590. this.show5 = false
  591. },
  592. closeImage(item, val, k) { //删除图片
  593. if (item.inspType == 'fpd') {
  594. this.insTypeData[k].attUrl.splice(val, 1)
  595. } else {
  596. this.tableData[k].attUrl.splice(val, 1)
  597. }
  598. that.$forceUpdate();
  599. },
  600. goDetail() { //去详情
  601. uni.navigateTo({
  602. url: '/pagesA/fire/check_active/check_implement_detail/check_implement_detail',
  603. })
  604. },
  605. checkImplementConfirm() { //确认保存检查项
  606. this.shuJu()
  607. var total = uni.getStorageSync('tableData') ? uni.getStorageSync('tableData') : {} //避免掉覆盖
  608. total[this.saveImplement.broadId] = this.tableData
  609. uni.setStorageSync('tableData', total)
  610. this.$modal.msg('暂存成功')
  611. // this.tableData.map(i => {
  612. // if (i.isdenger == undefined) {
  613. // this.show = true
  614. // }
  615. // }) //判断是否完成巡查
  616. //批量保存
  617. // console.log(this.show,'Confirmthis.show');
  618. // if (!this.show) {
  619. // saveCheckImplement(JSON.stringify(this.saveImplement)).then(response => { 调接口了
  620. // if (response.data) {
  621. // uni.showToast({
  622. // title: '保存成功',
  623. // icon: 'none',
  624. // duration: 2000
  625. // })
  626. // uni.navigateBack()
  627. // } else {
  628. // this.$modal.msgError('保存失败')
  629. // }
  630. // });
  631. // }
  632. },
  633. checkImplementRelease() { //提交发布
  634. this.shuJu()
  635. this.saveImplement.inspectList.map((i) => { //提交数据组装
  636. if (i.inspType == 'fpd') {
  637. i.hisFpdCreateReqVOList.map(k => {
  638. k.status = 0
  639. k.fpdId = k.id
  640. if (k.dangerDescribe != undefined) {
  641. let strs = ""
  642. strs += `${k.dangerDescribe},`
  643. i.description = strs.slice(0, strs.length - 1)
  644. }
  645. k.imgUrl1 = k.attUrl[0]
  646. k.imgUrl2 = k.attUrl[1]
  647. k.imgUrl3 = k.attUrl[2]
  648. k.fpdResultCreateReqVOList = []
  649. k.fpdResultCreateReqVOList = k.inspectResultList
  650. k.fpdResultCreateReqVOList.map(z => {
  651. z.broadId = this.formData.broadId
  652. z.fpdId = z.id
  653. z.resLable = z.subLable
  654. z.resValue = z.subValue
  655. z.status = 0
  656. if (z.subValue == 0 && z.isNormal ==
  657. 1) { //必传参数,只有该检查项正常为0,那么isdenger==1
  658. k.isdanger = 1
  659. i.isdanger = 1
  660. }
  661. })
  662. })
  663. } else {
  664. i.hisResultCreateReqVOList = i.inspectResultList
  665. i.hisResultCreateReqVOList.map(k => {
  666. k.status = 0
  667. k.broadId = this.formData.broadId
  668. k.fpdId = k.id
  669. k.resLable = k.subLable
  670. k.resValue = k.subValue
  671. k.status = 0
  672. if (k.subValue == 0 && k.isNormal == 1) {
  673. i.isdanger = 1
  674. }
  675. })
  676. }
  677. });
  678. //检查拍照是否有遗漏没有勾选拍照的----------
  679. let arrs = new Array()
  680. this.saveImplement.inspectList.map((i, index) => {
  681. if (i.inspType != 'fpd') {
  682. arrs[index] = new Array()
  683. i.inspectResultList.map((k, indexs) => {
  684. arrs[index][indexs] = new Array(i.inspectResultList.length)
  685. arrs[index][indexs] = k.subValue
  686. })
  687. }
  688. })
  689. arrs.map(i => {
  690. if (!i.includes(1)) {
  691. // this.yilou = true
  692. this.show = true
  693. return;
  694. }
  695. })
  696. // console.log(this.saveImplement, '消防设备和消防设施'); 屏蔽未检查校验2
  697. this.saveImplement.inspectList.map((i, index) => {
  698. if (i.inspType != 'fpd') { //有不正常的必须拍照
  699. i.inspectResultList.map((k, indexs) => {
  700. if (i.attUrl.length == 0) {
  701. if (k.isNormal == 1 && k.subValue == 0 && !this.yilou) return this.show3 =
  702. true
  703. }
  704. })
  705. } else if (i.inspType == 'fpd' && i.hisFpdCreateReqVOList.length == 0) {
  706. return this.show4 = true
  707. }
  708. })
  709. // console.log(this.saveImplement, '消防设备和消防设施'); 屏蔽未检查校验2
  710. //检查拍照是否有遗漏没有勾选的-----------
  711. if (!this.show && !this.show3 && !this.show4) { //屏蔽未检查校验2
  712. if (!this.show) {
  713. // 巡查未完成判断
  714. checkSubmitRelease(JSON.stringify(this.saveImplement)).then(response => {
  715. if (response.data) {
  716. uni.showToast({
  717. title: '提交成功',
  718. icon: 'none',
  719. duration: 2000
  720. })
  721. const table = uni.getStorageSync('tableData')
  722. delete table[this.saveImplement.broadId] //保存时删除掉保存的那一项再保存
  723. uni.setStorageSync('tableData', table)
  724. setTimeout(() => {
  725. uni.redirectTo({
  726. url: `/pagesA/fire/check_active/index?current=1&type=${this.type}`
  727. });
  728. }, 1000)
  729. } else {
  730. this.$modal.msgError('提交失败')
  731. }
  732. })
  733. }
  734. }
  735. },
  736. shuJu() {
  737. this.saveImplement.inspectList = this.tableData
  738. this.saveImplement.taskId = this.formData.id
  739. },
  740. // 获取数据
  741. getData(pageNo, value = '') {
  742. this.loading = true
  743. this.formData.pageNo = pageNo
  744. CheckActiveImplement(JSON.stringify(this.formData)).then(response => {
  745. if (response.data) {
  746. this.total = response.data.total
  747. this.loading = false;
  748. this.tableData = response.data.records
  749. this.tableData.map(i => {
  750. i.inspId = i.id
  751. i.loading = false
  752. // i.inspName = i.insp_name
  753. // i.inspCode = i.insp_code
  754. i.isreport = 0
  755. i.status = 0
  756. i.attUrl = []
  757. i.description = ''
  758. i.isdanger = i.isdanger
  759. i.hisFpdCreateReqVOList = []
  760. i.hisResultCreateReqVOList = []
  761. i.qrcodeShow = false
  762. // ----隐患
  763. i.choiceDanger = this.choiceDanger //隐患描述下拉的数据
  764. // ----隐患
  765. })
  766. }
  767. });
  768. // this.newInsTypeData.map(i => {
  769. // i.attUrl = []
  770. // })
  771. },
  772. // 触底的事件
  773. scrolltolower() {
  774. // 判断是否还有下一页数据
  775. if (this.formData.pageNo * this.formData.pageSize >= this.total) return uni.showToast({
  776. title: `数据加载完毕`
  777. })
  778. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  779. if (this.loading) return
  780. this.formData.pageNo += 1
  781. },
  782. noNormal() {
  783. this.$modal.alert('此检查项为消防设备,请对设备进行扫码')
  784. },
  785. normal(items, indexs, index, item) {
  786. this.tableData[index].description = this.description
  787. // 根据norNormal == 1判断哪一个是单独与其他互斥的
  788. this.id = items.id
  789. this.descriptIndex = index //给提交发布的描述用的
  790. this.tableData[index].inspectResultList.map(k => {
  791. if (k.isNormal == 1) this.nnorNormalValue = k.id
  792. //给提交发布的描述用的
  793. if (this.tableData[index].inspectResultList[indexs].isNormal != 1 && this.tableData[index]
  794. .inspectResultList[indexs].subValue != 1) {
  795. this.show2 = true
  796. }
  797. })
  798. // tableItem当前点击的复选框值
  799. let tableItem = this.tableData[index].inspectResultList[indexs]
  800. let ALLinspectResultList = this.tableData[index].inspectResultList
  801. let YesinspectResultList = [] //独一个
  802. let NorinspectResultList = [] //其他的互斥的
  803. var Y = ALLinspectResultList.filter(i => i.id == this.nnorNormalValue)
  804. var N = ALLinspectResultList.filter(i => i.id != this.nnorNormalValue)
  805. N.map(n => {
  806. NorinspectResultList.push(n.subValue)
  807. })
  808. Y.map(y => {
  809. YesinspectResultList.push(y.subValue)
  810. })
  811. // items.isdenger = 0 ? 1 : 0
  812. if (NorinspectResultList.includes(1)) { //如果互斥的数组存在true normal!=1的数组
  813. if (tableItem.id == this.nnorNormalValue) { //当点击的是value == this.nnorNormalValue是
  814. this.tableData[index].inspectResultList.map((i, kindex) => {
  815. if (i.id != this.nnorNormalValue) {
  816. i.subValue = 0
  817. this.show2 = false
  818. } else {
  819. i.subValue = 1
  820. }
  821. })
  822. } else {
  823. // tableItem.subValue = !tableItem.subValue //不为独一份时,执行改语句
  824. items.subValue = items.subValue == 0 ? 1 : 0
  825. this.show2 = false
  826. }
  827. } else { //如果互斥的数组不存在true,全是false normal!=1的数组
  828. if (tableItem.id == this.nnorNormalValue) { //如果点击的是独一份
  829. // tableItem.subValue = !tableItem.subValue //允许执行
  830. items.subValue = items.subValue == 0 ? 1 : 0
  831. } else { //如果点击的是互斥的
  832. // if (YesinspectResultList.includes(true)) { //是否存在第一份
  833. this.tableData[index].inspectResultList.map((i, kindex) => {
  834. if (i.id == this.nnorNormalValue) {
  835. i.subValue = 0
  836. }
  837. })
  838. // }
  839. // tableItem.subValue = !tableItem.subValue
  840. items.subValue = items.subValue == 0 ? 1 : 0
  841. }
  842. }
  843. if (items.isNormal == 0 && items.subValue == 1) {
  844. item.showDescription = true; // 显示描述框
  845. // ----隐患
  846. this.tableData[this.descriptIndex].choiceDanger.map(i => i.checkedListDanger = [])
  847. // ----隐患
  848. } else {
  849. item.showDescription = false; // 显示描述框
  850. }
  851. },
  852. // 消防设备扫码
  853. normalPopup(items, indexs, index) {
  854. // this.insTypeData.map(k => {
  855. // k.attUrl = []
  856. // })
  857. this.insTypeData[index].inspectResultList.map(k => {
  858. if (k.isNormal == 1) this.nnorNormalValue = k.id
  859. if (this.insTypeData[index].inspectResultList[indexs].isNormal != 1 && this.insTypeData[index]
  860. .inspectResultList[indexs].subValue != 1) {
  861. this.show5 = true
  862. }
  863. })
  864. let tableItem = this.insTypeData[index].inspectResultList[indexs]
  865. let ALLinspectResultList = this.insTypeData[index].inspectResultList
  866. let YesinspectResultList = []
  867. let NorinspectResultList = []
  868. var Y = ALLinspectResultList.filter(i => i.id == this.nnorNormalValue)
  869. var N = ALLinspectResultList.filter(i => i.id != this.nnorNormalValue)
  870. N.map(n => {
  871. NorinspectResultList.push(n.subValue)
  872. })
  873. Y.map(y => {
  874. YesinspectResultList.push(y.subValue)
  875. })
  876. // items.isdenger = 0 ? 1 : 0
  877. if (NorinspectResultList.includes(1)) { //如果互斥的数组存在true normal!=1的数组
  878. if (tableItem.id == this.nnorNormalValue) {
  879. this.insTypeData[index].inspectResultList.map((i, kindex) => {
  880. if (i.id != this.nnorNormalValue) {
  881. i.subValue = 0
  882. } else {
  883. i.subValue = 1
  884. }
  885. })
  886. } else {
  887. items.subValue = items.subValue == 0 ? 1 : 0
  888. }
  889. } else {
  890. if (tableItem.id == this.nnorNormalValue) {
  891. items.subValue = items.subValue == 0 ? 1 : 0
  892. } else {
  893. // if (YesinspectResultList.includes(true)) { //是否存在第一份
  894. this.insTypeData[index].inspectResultList.map((i, kindex) => {
  895. if (i.id == this.nnorNormalValue) {
  896. i.subValue = 0
  897. }
  898. })
  899. // }
  900. items.subValue = items.subValue == 0 ? 1 : 0
  901. }
  902. }
  903. // ----扫码选择隐患
  904. if (items.isNormal == 0 && items.subValue == 1) {
  905. this.show5 = true; // 显示描述框
  906. // this.insTypeData.choiceDanger.map(i => i.checkedListDanger = [])
  907. } else {
  908. this.show5 = false; // 显示描述框
  909. }
  910. // ----扫码选择隐患
  911. },
  912. checkPopupConfirm(fpdId) { //弹出得到的那一条数据insTypeData的id 弹出保存
  913. //this.insTypeData[0]扫二维码后点击出现的一条消防列表数据内容 this.newInsTypeData的多条数据列表
  914. let arr = []
  915. let normalArr = 0
  916. this.insTypeData[0].inspectResultList.map((i, index) => {
  917. arr.push(i.subValue)
  918. if (i.isNormal == 1) {
  919. normalArr = index //找到正常的所在的index
  920. }
  921. })
  922. if (arr.includes(1)) { //包含了证明勾选了
  923. arr.map((i, index) => {
  924. if (i == 1) { //如果i是1表示点击了隐患,判断点击的隐患是否是isnormal=1的,如不是并且图片长度为0,就提示拍照
  925. // if (index != normalArr && this.insTypeData[0].attUrl.length == 0) {
  926. // that.$modal.alert('请对有问题设备进行拍照')
  927. // } else {
  928. // this.newInsTypeData = [...this.newInsTypeData, ...this.insTypeData]
  929. // uni.setStorageSync('newInsTypeDatas', this.newInsTypeData)
  930. // this.newInsTypeData = uni.getStorageSync('newInsTypeDatas')
  931. this.tableData.map(i => {
  932. if (i.id == this.checkTableDataId) {
  933. i.dengerType=this.insTypeData[0].dengerType
  934. i.hisFpdCreateReqVOList = [...i.hisFpdCreateReqVOList, ...this.insTypeData]
  935. i.hisFpdCreateReqVOList.map(k => {
  936. k['broadId'] = that.formData.broadId
  937. if (k.id == fpdId) {
  938. k['dangerDescribe'] = this.description2
  939. this.description2 = ''
  940. }
  941. })
  942. }
  943. })
  944. this.insTypeData = []
  945. this.insTypeData.map(k => {
  946. k.attUrl = [],
  947. k.loading = false,
  948. k.dengerType = ''
  949. })
  950. this.maShow = false
  951. // }
  952. }
  953. })
  954. } else {
  955. that.$modal.msg('请勾选检查结果')
  956. }
  957. // ----扫码选择隐患
  958. this.description2 = ''
  959. this.show5 = false
  960. // this.tableData.map((i) => { //这一段不用放开,以前是用于消防设备扫多个码统计数据展示的
  961. // if (i.id = fpdId) {
  962. // let isNormalZero=new Array(i.inspectResultList.length) //新建数组用来放isNormal为1和不为1处理后的分别的数组
  963. // this.newInsTypeData.map(k => {
  964. // k.inspectResultList.map((j,index) => {
  965. // isNormalZero[index]=[]
  966. // isNormalZero[index].push(j.subValue)
  967. // })
  968. // })
  969. // i.inspectResultList.map((g,index)=>{
  970. // if(isNormalZero[index].includes(1)){
  971. // g.subValue=1
  972. // if(g.isNormal==1){
  973. // g.subValue=0
  974. // }
  975. // }
  976. // })
  977. // }
  978. // })
  979. // this.$forceUpdate()
  980. },
  981. checkPopupCancel() {
  982. this.tableData[this.onDecodeIndex].qrcodeShow = false
  983. this.maShow = false
  984. },
  985. //拍照上传
  986. photoUpload(val, index) {
  987. let pictures = [];
  988. var that = this;
  989. if (val.inspType != 'fpd') {
  990. that.tableData[index].loading = true
  991. } else {
  992. that.insTypeData[index].loading = true
  993. }
  994. this.$forceUpdate()
  995. uni.chooseImage({
  996. sourceType: ['camera'], //实现拍照
  997. count: 3,
  998. sizeType: ['original', 'compressed'],
  999. // sourceType: ['album','camera'], //打开系统相册
  1000. success(res) {
  1001. // that.loading = true
  1002. if (Array.isArray(res.tempFilePaths)) { //从相册选择有三张的情况
  1003. // if (res.tempFilePaths.length === 3) {
  1004. // pictures.length = 0
  1005. // } else if (res.tempFilePaths.length == 2 && pictures.length == 2) {
  1006. // pictures.splice(0, 1)
  1007. // }
  1008. res.tempFilePaths.forEach(item => {
  1009. // let picture = {
  1010. // url: item,
  1011. // show: false
  1012. // }
  1013. // pictures.push(picture)
  1014. loadImage(
  1015. item,
  1016. function(canvas) {
  1017. canvas.toBlob(function(blob) {
  1018. // 压缩后的 Blob 对象
  1019. const compressedFile = blob;
  1020. // 将压缩后的文件 `compressedFile` 转换为临时URL
  1021. const fileUrl = URL.createObjectURL(
  1022. compressedFile);
  1023. uni.uploadFile({
  1024. url: baseUrl +
  1025. '/admin-api/infra/file/upload', //后端用于处理图片并返回图片地址的接口
  1026. filePath: item,
  1027. name: 'file',
  1028. header: {
  1029. "Authorization": 'Bearer ' +
  1030. getAccessToken(),
  1031. }, //请求token
  1032. success: (res) => {
  1033. // that.loading = false
  1034. if (that.tableData[index]
  1035. .loading) {
  1036. that.tableData[index]
  1037. .loading = false
  1038. } else if (that.insTypeData[
  1039. index]
  1040. .loading) {
  1041. that.insTypeData[index]
  1042. .loading = false
  1043. }
  1044. let imgUrl = JSON.parse(res
  1045. .data)
  1046. // that.imageList.push(imgUrl.data)
  1047. if (val.inspType != 'fpd') {
  1048. that.tableData.map((i,
  1049. index) => {
  1050. if (val.id == i
  1051. .id) {
  1052. i.attUrl
  1053. .push(
  1054. imgUrl
  1055. .data
  1056. )
  1057. }
  1058. })
  1059. } else { //消防设备外(扫一扫下方)展示的图片
  1060. //弹出层的消防设备展示的图片
  1061. that.insTypeData.map((i,
  1062. index) => {
  1063. if (val.id == i
  1064. .id) {
  1065. i.attUrl
  1066. .push(
  1067. imgUrl
  1068. .data
  1069. )
  1070. }
  1071. })
  1072. }
  1073. that.$forceUpdate();
  1074. // // 返回的url
  1075. },
  1076. fail: (err) => {
  1077. // that.loading = false
  1078. if (that.tableData[index]
  1079. .loading) {
  1080. that.tableData[index]
  1081. .loading = false
  1082. } else if (that.insTypeData[
  1083. index]
  1084. .loading) {
  1085. that.insTypeData[index]
  1086. .loading = false
  1087. }
  1088. this.$modal.msg(err.msg)
  1089. }
  1090. })
  1091. // // 保存到本地
  1092. // uni.saveImageToPhotosAlbum({
  1093. // filePath: item,
  1094. // })
  1095. // 上传完毕后,释放临时URL
  1096. URL.revokeObjectURL(fileUrl);
  1097. }, 'image/jpeg', 0.6); // 设置压缩后的图片格式为 JPEG,压缩质量为 0.6
  1098. }, {
  1099. canvas: true,
  1100. maxWidth: 800
  1101. } // 设置最大宽度为 800px
  1102. );
  1103. })
  1104. }
  1105. }
  1106. })
  1107. },
  1108. // // 将拍的照片的base64转成文件格式然后再转成FormData,就可以使用上传图片的接口了
  1109. // base64ToFile(base64){
  1110. // const dataArr = base64.split(',');
  1111. // const byteString = atob(dataArr[1]);
  1112. // const options = {
  1113. // type:'image/jpeg',
  1114. // endings:'native'
  1115. // };
  1116. // const u8Arr = new Uint8Array(byteString.length)
  1117. // for(let i=0;i<byteString.length;i++){
  1118. // u8Arr[i]=byteString.charCodeAt(i);
  1119. // }
  1120. // return new File([u8Arr],'phone.png',options)
  1121. // },
  1122. //methode结束
  1123. }
  1124. }
  1125. </script>
  1126. <style lang="scss" scoped>
  1127. page {
  1128. background-color: rgb(245, 247, 249) !important;
  1129. }
  1130. .container {
  1131. // height: 100vh;
  1132. position: relative;
  1133. background-color: rgb(245, 247, 249);
  1134. }
  1135. /deep/.uni-card {
  1136. box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
  1137. border-radius: 20rpx;
  1138. }
  1139. .tupian {
  1140. width: 48rpx;
  1141. height: 48rpx;
  1142. }
  1143. .tupian2 {
  1144. width: 30rpx;
  1145. height: 30rpx;
  1146. }
  1147. .text {
  1148. text-align: center;
  1149. color: #000;
  1150. font-size: 26rpx;
  1151. margin-top: 20rpx;
  1152. }
  1153. .text2 {
  1154. text-align: center;
  1155. color: #000;
  1156. font-size: 22rpx;
  1157. margin-top: 10rpx;
  1158. }
  1159. .child {
  1160. margin: 20rpx 0 0 20rpx;
  1161. border-radius: 10rpx;
  1162. .child-new {
  1163. display: flex;
  1164. .child-new-item {
  1165. width: 30%;
  1166. margin-top: 25%;
  1167. transform: translateY(-50px);
  1168. }
  1169. .child-result {
  1170. /deep/.data-v-525ecd67 {
  1171. // width: 130rpx;
  1172. height: 100rpx;
  1173. }
  1174. }
  1175. }
  1176. }
  1177. .titles {
  1178. padding: 20rpx 0;
  1179. color: #383838;
  1180. }
  1181. .grid-item-box {
  1182. flex: 1;
  1183. display: flex;
  1184. flex-direction: column;
  1185. align-items: center;
  1186. justify-content: center;
  1187. padding: 15px 0;
  1188. }
  1189. /deep/ .uni-grid-item {
  1190. height: 140rpx !important;
  1191. }
  1192. /deep/.uni-textarea-textarea {
  1193. // border: 1px solid #4CB2B6;
  1194. border-radius: 16rpx;
  1195. }
  1196. .shebeidesrip {
  1197. /deep/.uni-textarea-textarea {
  1198. border: none;
  1199. border-radius: 16rpx;
  1200. }
  1201. }
  1202. .btnList {
  1203. display: flex
  1204. }
  1205. // /deep/.u-icon--right[data-v-172979f2],
  1206. // /deep/.u-icon--right.data-v-172979f2,
  1207. // /deep/.u-icon--right {
  1208. // background-color: #f8f8f8;
  1209. // border-radius: 5rpx;
  1210. // position: absolute;
  1211. // top: -14rpx;
  1212. // right: 20rpx;
  1213. // }
  1214. .uni-grid-wraps {
  1215. margin-left: 60rpx;
  1216. // margin-bottom: 40rpx;
  1217. margin-bottom: 480rpx !important;
  1218. }
  1219. /deep/.u-slide-up-enter-active[data-v-39e33bf2],
  1220. /deep/.u-slide-up-enter-active.data-v-39e33bf2,
  1221. /deep/.u-slide-up-enter-active {
  1222. height: 90% !important;
  1223. }
  1224. .springFarm {
  1225. margin-left: 40rpx;
  1226. }
  1227. .show-title {
  1228. font-size: 32rpx;
  1229. color: #383838;
  1230. margin: 40rpx 0;
  1231. }
  1232. .tiantupian {
  1233. margin: 40rpx;
  1234. width: 100rpx;
  1235. height: 100rpx
  1236. }
  1237. /deep/.u-modal {
  1238. border: 1px solid #4CB2B6 !important;
  1239. }
  1240. .slot-contents {
  1241. margin-left: 40rpx;
  1242. }
  1243. /deep/ .slot-contents .uni-textarea-textarea {
  1244. border: 1px solid #4CB2B6;
  1245. // background-color: #F0F2F3;
  1246. }
  1247. /deep/ .uni-textarea-placeholder {
  1248. color: #274647;
  1249. margin-top: 20rpx;
  1250. margin-left: 30rpx;
  1251. }
  1252. /deep/.canvasBox {
  1253. .box {
  1254. width: 600rpx;
  1255. /* 设置扫码容器宽度 */
  1256. height: 600rpx;
  1257. /* 设置扫码容器高度 */
  1258. }
  1259. }
  1260. //隐患弹框
  1261. /deep/.u-popup__content {
  1262. overflow-y: auto;
  1263. }
  1264. .text-xl {
  1265. font-size: 18px;
  1266. font-weight: 600;
  1267. }
  1268. .person-forward {
  1269. padding-top: 40rpx;
  1270. display: flex;
  1271. flex-direction: column;
  1272. flex-wrap: wrap;
  1273. overflow-y: auto;
  1274. margin-bottom: 100rpx;
  1275. }
  1276. </style>