rectifyDetails.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228
  1. <!-- 整改详情 -->
  2. <template>
  3. <view id="rectifyDetails">
  4. <view class="info-max-page" v-if="pageType == 1">
  5. <!-- <view class="position-button" v-if="buttonArrayType != 4">
  6. <picker @change="buttonChange" :value="buttonIndex" :range="buttonArray">查看报告</picker>
  7. </view> -->
  8. <view class="top-info-box">
  9. <view class="top-min-info-box">
  10. <view>整改类型:</view>
  11. <view>{{newData.zgType == 0?'一般整改':'重大整改'}}</view>
  12. </view>
  13. <view class="top-min-info-box">
  14. <view>实验室名称:</view>
  15. <view>{{newData.laboratoryName}}</view>
  16. </view>
  17. <view class="top-min-info-box">
  18. <view>房间号:</view>
  19. <view>{{newData.fjNumber}}</view>
  20. </view>
  21. <view class="top-min-info-box">
  22. <view>所属实验楼:</view>
  23. <view>{{newData.buildingName}}</view>
  24. </view>
  25. <view class="top-min-info-box">
  26. <view>实验室负责人:</view>
  27. <view>{{newData.fzrName}}</view>
  28. </view>
  29. <view class="top-min-info-box">
  30. <view>联系方式:</view>
  31. <view>{{newData.fzrLxfs}}</view>
  32. </view>
  33. <view class="top-min-info-box">
  34. <view>检查单位:</view>
  35. <view>{{newData.jcDwName}}</view>
  36. </view>
  37. <view class="top-min-info-box">
  38. <view>检查时间:</view>
  39. <view>{{newData.createTime}}</view>
  40. </view>
  41. <view class="top-min-info-box">
  42. <view>整改截止时间: </view>
  43. <view>{{newData.zgjzTime}}</view>
  44. </view>
  45. <view class="top-min-info-box" v-if="details.spStatus != 0">
  46. <view>整改确认时间: </view>
  47. <view>{{details.zgTime}}</view>
  48. </view>
  49. <view class="top-min-info-box" v-if="details.spStatus == 2">
  50. <view>整改驳回时间: </view>
  51. <view>{{details.spTime}}</view>
  52. </view>
  53. <view class="top-min-info-box" v-if="details.spStatus == 4">
  54. <view>整改完成时间: </view>
  55. <view>{{details.zgTime}}</view>
  56. </view>
  57. <view class="top-info-button" @click="infoClickButton">
  58. <view>{{showType?"收起详情":"查看详情"}}</view>
  59. <img v-if="showType" src="@/images/Version2.2/icon_aqjc_sq.png">
  60. <img v-if="!showType" src="@/images/Version2.2/icon_aqjc_sq_two.png">
  61. </view>
  62. </view>
  63. <view class="bottom-info-box" v-show="showType">
  64. <view class="bottom-info-title-box" v-if="details.spStatus==0">
  65. <img src="@/images/Version2.2/icon_aqjc_czwt.png">
  66. <view>存在隐患</view>
  67. </view>
  68. <view class="bottom-info-title-box" v-if="details.spStatus != 0">
  69. <img src="@/images/Version2.2/icon_aqjc_zgxx.png">
  70. <view>整改信息</view>
  71. </view>
  72. <!-- <view class="bottom-info-text-box" v-if="details.spStatus==4">
  73. <view>整改结果:</view>
  74. <view>{{newData.zgJg}}</view>
  75. </view> -->
  76. <view class="bottom-info-text-box" v-if="details.spStatus==2">
  77. <view>驳回原因:</view>
  78. <view>{{details.spMs}}</view>
  79. </view>
  80. <view class="rectified-max-box">
  81. <view class="rectified-for-box" v-if="details.isZg != 1 && details.spStatus!=2">
  82. <!-- <view class="rectified-for-position-index">{{index+1}}</view> -->
  83. <img v-if="details.spStatus == 4" class="rectified-for-position-img" src="@/images/Version2.2/icon_bg_ywc.png">
  84. <view class="rectified-for-title">{{details.jcxName}}</view>
  85. <view class="rectified-for-name" v-if="details.isLingshi == 1">临时检查项</view>
  86. <view class="rectified-for-name" v-if="details.isLingshi == 0">{{details.jcxSstkMs}}</view>
  87. <view class="rectified-for-text-max-box">
  88. <view class="rectified-for-text-box">
  89. <view>隐患描述:</view>
  90. <view>{{details.yhMs}}</view>
  91. </view>
  92. <!-- <view class="rectified-for-text-box" v-if="details.isZg == 0 && newData.zgType == 0">
  93. <view>整改描述:</view>
  94. <view>{{details.zgMs}}</view>
  95. </view> -->
  96. <!-- <view class="rectified-for-text-box" v-if="details.isZg == 0 && newData.zgType == 1">
  97. <view>原因分析:</view>
  98. <view>{{details.zgYyfx}}</view>
  99. </view>
  100. <view class="rectified-for-text-box" v-if="details.isZg == 0 && newData.zgType == 1">
  101. <view>整改措施:</view>
  102. <view>{{details.zgCs}}</view>
  103. </view> -->
  104. <view class="rectified-for-text-box" v-if="details.isZg == 1">
  105. <view>证明信息:</view>
  106. <view>{{details.zmClMs}}</view>
  107. </view>
  108. </view>
  109. <view class="rectified-for-img-max-box">
  110. <view class="rectify_front">
  111. <view class="rectify_front_t">整改前照片:</view>
  112. <view class="rectify_front_b" @click="lockImg(details.yhImg)">
  113. <img :src="itemUrl" v-for="(itemUrl,indexTwo) in details.yhImg" :key="indexTwo">
  114. </view>
  115. </view>
  116. <!-- 循环复核信息 -->
  117. <view v-for="(item2,index2) in details.detailslogList" :key="index2" style="border-bottom: 1px dotted #E0E0E0;">
  118. <view class="top-info-box rectify_info">
  119. <view class="top-min-info-box">
  120. <view>整改时间:</view>
  121. <view>{{item2.createTime}}</view>
  122. </view>
  123. <view class="top-min-info-box">
  124. <view>整改人:</view>
  125. <view>{{item2.zgUserName}}</view>
  126. </view>
  127. <view class="top-min-info-box">
  128. <view>整改描述:</view>
  129. <view>{{item2.zgMs}}</view>
  130. </view>
  131. </view>
  132. <view class="rectify_later">
  133. <view class="rectify_later_t">整改后照片:</view>
  134. <view class="rectify_later_b" @click="lockImg(item2.yhZghImg)">
  135. <img :src="itemUrl" v-for="(itemUrl,indexTwo) in item2.yhZghImg" :key="indexTwo">
  136. </view>
  137. </view>
  138. <view class="top-info-box rectify_info" v-if='rejectItem.spTime'>
  139. <view class="top-min-info-box" >
  140. <view>复核时间:</view>
  141. <view v-if="item2.spTime">{{item2.spTime}}</view>
  142. </view>
  143. <view class="top-min-info-box">
  144. <view>复核人:</view>
  145. <view v-if="item2.spUserName">{{item2.spUserName}}</view>
  146. </view>
  147. <view class="top-min-info-box">
  148. <view>复核描述:</view>
  149. <view v-if="item2.spSm">{{item2.spSm}}</view>
  150. </view>
  151. </view>
  152. </view>
  153. </view>
  154. </view>
  155. <!-- 驳回 -->
  156. <view class="rectified-for-box" v-if="details.isZg != 1 && details.spStatus==2">
  157. <img v-if="details.spStatus == 4" class="rectified-for-position-img" src="@/images/Version2.2/icon_bg_ywc.png">
  158. <view class="rectified-for-title">{{details.jcxName}}</view>
  159. <view class="rectified-for-name" v-if="details.isLingshi == 0">{{details.jcxSstkMs}}</view>
  160. <view class="rectified-for-text-max-box">
  161. <view class="rectified-for-text-box">
  162. <view>隐患描述:</view>
  163. <view>{{details.yhMs}}</view>
  164. </view>
  165. </view>
  166. <view class="rectified-for-img-max-box">
  167. <!-- <view class="rectified-for-img-box" @click="lockImg(details.yhImg)" v-if="details.yhImg">
  168. <img :src="baseUrl+itemUrl" v-if="indexTwo<4" v-for="(itemUrl,indexTwo) in details.yhImg" :key="indexTwo">
  169. <view class="rectified-for-img-min-text" style="color:#999;" v-if="!details.yhImg">未上传隐患照片</view>
  170. <view class="rectified-for-img-min-text" v-if="details.yhImg[0]">{{details.spStatus==0?'隐患照片':'整改前照片'}} >></view>
  171. </view>
  172. <view class="rectified-for-img-box" @click="lockImg(item.yhZghImg)" v-if="details.yhZghImg">
  173. <img :src="baseUrl+itemUrl" v-if="indexTwo<4" v-for="(itemUrl,indexTwo) in details.yhZghImg" :key="indexTwo">
  174. <view class="rectified-for-img-min-text">整改后照片 >></view>
  175. </view> -->
  176. <view class="rectified-for-img-box" @click="lockImg(details.yhImg)" v-if="details.yhImg" >
  177. <img :src="itemUrl" v-for="(itemUrl,indexTwo) in details.yhImg" :key="indexTwo">
  178. <view class="rectified-for-img-min-text" style="color:#999;" v-if="!details.yhImg">未上传隐患照片</view>
  179. <view class="rectified-for-img-min-text" v-if="details.yhImg[0]">隐患照片 >></view>
  180. </view>
  181. <view v-for="(rejectItem,rejectIndex) in details.detailslogList" :key="rejectIndex" style="border-bottom: 1px dotted #E0E0E0;">
  182. <view class="top-info-box rectify_info">
  183. <view class="top-min-info-box">
  184. <view>整改时间:</view>
  185. <view>{{rejectItem.zgTime}}</view>
  186. </view>
  187. <view class="top-min-info-box">
  188. <view>整改人:</view>
  189. <view>{{rejectItem.zgUserName}}</view>
  190. </view>
  191. <view class="top-min-info-box">
  192. <view>整改描述:</view>
  193. <view>{{rejectItem.zgMs}}</view>
  194. </view>
  195. </view>
  196. <view class="rectify_later" style='border-bottom: 1px solid #E0E0E0;'>
  197. <view class="rectify_later_t">整改后照片:</view>
  198. <view class="rectify_later_b" @click="lockImg(rejectItem.yhZghImg)">
  199. <img :src="itemUrl" v-for="(itemUrl,indexTwo) in rejectItem.yhZghImg" :key="indexTwo">
  200. </view>
  201. </view>
  202. <view class="top-info-box rectify_info" v-if='rejectItem.spTime'>
  203. <view class="top-min-info-box">
  204. <view>复核时间:</view>
  205. <view>{{rejectItem.spTime}}</view>
  206. </view>
  207. <view class="top-min-info-box">
  208. <view>复核人:</view>
  209. <view>{{rejectItem.spUserName}}</view>
  210. </view>
  211. <view class="top-min-info-box">
  212. <view>复核描述:</view>
  213. <view>{{rejectItem.spSm}}</view>
  214. </view>
  215. </view>
  216. </view>
  217. <view class="input-box" style="margin: 0;">
  218. <view class="text-p">整改描述</view>
  219. <view class="bj-p">*</view>
  220. <textarea class="textarea-p" maxlength="50" v-model="form.zgMs" placeholder="请输入整改描述"></textarea>
  221. </view>
  222. <view class="img-up-box" style="margin: 0;">
  223. <view class="text-p">整改照片</view>
  224. <view class="bj-p"></view>
  225. <view class="img-box">
  226. <view class="min-for-img-box" v-for="(url,index) in form.yhZghImg" :key="index">
  227. <img class="min-for-img" @click.stop="uploadLockImg(url)"
  228. :src="baseUrl+url">
  229. <img class="del-img" @click.stop="delZgImg(index)" src="@/images/icon_ssp_closure.png">
  230. </view>
  231. <view class="up-img" @click="selectImage">
  232. <view>上传</view>
  233. </view>
  234. </view>
  235. </view>
  236. </view>
  237. </view>
  238. </view>
  239. <view class="bottom-info-title-box" v-if="details.spStatus==3">
  240. <img src="@/images/Version2.2/icon_aqjc_zgxx.png">
  241. <view>未整改信息</view>
  242. </view>
  243. <view class="rectified-max-box">
  244. <view class="rectified-for-box" v-if="details.isZg == 1" >
  245. <!-- <view class="rectified-for-position-index">{{index+1}}</view> -->
  246. <view class="rectified-for-title">{{details.jcxName}}</view>
  247. <view class="rectified-for-name" v-if="details.isLingshi == 1">临时检查项</view>
  248. <view class="rectified-for-name" v-if="details.isLingshi == 0">{{details.jcxSstkMs}}</view>
  249. <view class="rectified-for-text-max-box">
  250. <view class="rectified-for-text-box">
  251. <view>隐患描述:</view>
  252. <view>{{details.yhMs}}</view>
  253. </view>
  254. <view class="rectified-for-text-box" v-if="details.isZg == 0 && newData.zgType == 0">
  255. <view>整改描述:</view>
  256. <view>{{details.zgMs}}</view>
  257. </view>
  258. <view class="rectified-for-text-box" v-if="details.isZg == 0 && newData.zgType == 1">
  259. <view>原因分析:</view>
  260. <view>{{details.zgYyfx}}</view>
  261. </view>
  262. <view class="rectified-for-text-box" v-if="details.isZg == 0 && newData.zgType == 1">
  263. <view>整改措施:</view>
  264. <view>{{details.zgCs}}</view>
  265. </view>
  266. <view class="rectified-for-text-box" v-if="details.isZg == 0">
  267. <view>证明信息:</view>
  268. <view>{{details.zmClMs}}</view>
  269. </view>
  270. </view>
  271. <view class="rectified-for-img-max-box">
  272. <view class="rectified-for-img-box" @click="lockImg(details.yhImg)" v-if="details.yhImg">
  273. <img :src="itemUrl" v-for="(itemUrl,indexTwo) in details.yhImg" :key="indexTwo">
  274. <view class="rectified-for-img-min-text" style="color:#999;" v-if="!details.yhImg">未上传隐患照片</view>
  275. <view class="rectified-for-img-min-text" v-if="details.yhImg">{{details.spStatus==0?'隐患照片':'整改前照片'}} >></view>
  276. </view>
  277. <view class="rectified-for-img-box" @click="lockImg(details.zmClImg)" v-if="details.zmClImg">
  278. <img :src="itemUrl" v-for="(itemUrl,indexTwo) in details.zmClImg" :key="indexTwo">
  279. <view class="rectified-for-img-min-text">证明材料 >></view>
  280. </view>
  281. </view>
  282. <view class="input-box" v-if="details.spStatus == 0 || details.spStatus == 2">
  283. <view class="text-p">整改描述</view>
  284. <view class="bj-p">*</view>
  285. <textarea class="textarea-p" maxlength="50" v-model="form.zgMs" placeholder="请输入整改描述"></textarea>
  286. </view>
  287. <view class="img-up-box" v-if="details.spStatus == 0 || details.spStatus == 2">
  288. <view class="text-p">整改照片</view>
  289. <view class="bj-p"></view>
  290. <view class="img-box">
  291. <view class="min-for-img-box" v-for="(url,index) in form.yhZghImg" :key="index">
  292. <img class="min-for-img" @click.stop="uploadLockImg(url)"
  293. :src="baseUrl+url">
  294. <img class="del-img" @click.stop="delZgImg(index)" src="@/images/icon_ssp_closure.png">
  295. </view>
  296. <view class="up-img" @click="selectImage">
  297. <view>上传</view>
  298. </view>
  299. </view>
  300. </view>
  301. </view>
  302. </view>
  303. </view>
  304. <!-- <view class="info-bottom-button-box" v-if="details.spStatus == 0 || details.spStatus == 3" @click="goUpData">完成整改</view> -->
  305. <view class="info-bottom-button-box-three" v-if="details.spStatus == 0">
  306. <view @click="goUpData(3)">暂无法整改</view>
  307. <view @click="goUpData(1)">完成整改</view>
  308. </view>
  309. <!-- <view class="info-bottom-button-box" v-if="details.spStatus == 2" @click="goUpData(1)">再次提交</view> -->
  310. <!-- <view class="info-bottom-button-box-two" v-if="details.spStatus == 1">审核中</view> -->
  311. <view class="info-bottom-button-box-three" v-if="details.spStatus == 2" >
  312. <view @click="goUpData(3)">暂无法整改</view>
  313. <view @click="goUpData(1)">再次提交</view>
  314. </view>
  315. <view class="info-bottom-button-box-three" v-if="details.spStatus == 1" >
  316. <view @click="goUpData(2)">复核驳回</view>
  317. <view @click="goUpData(4)">复核通过</view>
  318. </view>
  319. <!-- <view class="info-bottom-button-box-three" v-if="userId==newData.createUserId && (details.spStatus == 1 || details.spStatus == 3)">
  320. <view @click="pageClick(2)">驳回</view>
  321. <view @click="pageClick(3)">审核通过</view>
  322. </view> -->
  323. <view class="info-bottom-button-box-two" v-if="details.spStatus == 4">整改完成</view>
  324. </view>
  325. <view class="input-max-box" v-if="pageType == 2">
  326. <view class="input-box">
  327. <textarea maxlength="100" v-model="text" placeholder="请输入驳回原因"></textarea>
  328. </view>
  329. <view class="input-button-box">
  330. <view class="out-button" @click="pageClick(1)">返回</view>
  331. <view class="input-button" @click="upDataClick(2)">提交</view>
  332. </view>
  333. </view>
  334. <view class="input-max-box" v-if="pageType == 3">
  335. <view class="input-box">
  336. <textarea maxlength="100" v-model="text" placeholder="请输入整改结果"></textarea>
  337. </view>
  338. <view class="input-button-box">
  339. <view class="out-button" @click="pageClick(1)">返回</view>
  340. <view class="input-button" @click="upDataClick(3)">提交</view>
  341. </view>
  342. </view>
  343. </view>
  344. </template>
  345. <script>
  346. import { config } from '@/api/request/config.js'
  347. import { RecordDettailsListNew,editListUpdate,} from '@/api/index.js'
  348. export default {
  349. name: "rectifyDetails",
  350. data() {
  351. return {
  352. userId:uni.getStorageSync('userId'),
  353. //页面状态
  354. pageType:1,
  355. id:"",
  356. text:'',
  357. baseUrl:config.base_url,
  358. //选项
  359. buttonIndex:0,
  360. buttonArray:[],
  361. buttonArrayType:"",
  362. //详情开关
  363. showType:false,
  364. //数据
  365. newData:{},
  366. details:{},
  367. form:{
  368. yhZghImg:[],
  369. },
  370. }
  371. },
  372. onLoad(option) {
  373. console.log(this.baseUrl)
  374. let item=JSON.parse(option.item)
  375. this.id = item.id;
  376. // 动态修改导航名称
  377. uni.setNavigationBarTitle({
  378. title:item.laboratoryName
  379. })
  380. },
  381. onShow() {
  382. console.log(this.baseUrl)
  383. this.getInfo();
  384. },
  385. methods: {
  386. pageClick(type){
  387. if(this.pageType != type){
  388. this.pageType = type;
  389. }
  390. },
  391. upDataClick(type){
  392. let self = this;
  393. if(!this.text){
  394. uni.showToast({
  395. title: this.pageType==2?'请输入驳回原因':(this.pageType == 3?'请输入整改结果':''),
  396. icon:"none",
  397. mask:true,
  398. duration: 2000
  399. });
  400. return
  401. }
  402. if(type == 2){
  403. let obj = {
  404. id: self.details.id,
  405. checkId: self.details.checkId,
  406. spMs: self.text,
  407. spStatus: 2,
  408. };
  409. uni.showModal({
  410. content: '确认要驳回吗?',
  411. cancelColor:"#999",
  412. confirmColor:"#0183FA",
  413. success: function (res) {
  414. if (res.confirm) {
  415. self.checkRecordUpdate(obj);
  416. console.log('用户点击确定');
  417. } else if (res.cancel) {
  418. console.log('用户点击取消');
  419. }
  420. }
  421. });
  422. }else if(type == 3){
  423. let obj = {
  424. id: self.details.id,
  425. checkId: self.details.checkId,
  426. spMs: self.text,
  427. spStatus: 4,
  428. }
  429. uni.showModal({
  430. content: '确认要审核通过吗?',
  431. cancelColor:"#999",
  432. confirmColor:"#0183FA",
  433. success: function (res) {
  434. if (res.confirm) {
  435. self.checkRecordUpdate(obj);
  436. console.log('用户点击确定');
  437. } else if (res.cancel) {
  438. console.log('用户点击取消');
  439. }
  440. }
  441. });
  442. }
  443. },
  444. async checkRecordUpdate(obj){
  445. const {data} = await editListUpdate(obj);
  446. if(data.code == 200){
  447. uni.showToast({
  448. title: '操作成功',
  449. icon:"none",
  450. mask:true,
  451. duration: 2000
  452. });
  453. setTimeout(function(){
  454. uni.navigateBack();
  455. },2000);
  456. }
  457. },
  458. // 整改上传
  459. selectImage() {
  460. let self = this;
  461. if(this.form.yhZghImg.length>4){
  462. uni.showToast({
  463. title: '最多上传5张图片',
  464. icon:"none",
  465. mask:true,
  466. duration: 2000
  467. });
  468. return
  469. }
  470. wx.chooseImage({
  471. count: 1,
  472. sizeType: ["original", "compressed"],
  473. sourceType: ["album", "camera"],
  474. success: function(res) {
  475. let tempFilePaths = res.tempFilePaths[0];
  476. self.zgUploadImg(tempFilePaths);
  477. }
  478. });
  479. },
  480. async zgUploadImg(tempFilePaths){
  481. var self = this;
  482. uni.showLoading({
  483. title: '上传中',
  484. mask: true
  485. });
  486. uni.uploadFile({
  487. url: config.base_url+'/base/file/upload', //仅为示例,非真实的接口地址
  488. header:{'Authorization':uni.getStorageSync('token')},
  489. filePath: tempFilePaths,
  490. name: 'file',
  491. formData: {
  492. 'user': 'test'
  493. },
  494. success: (uploadFileRes) => {
  495. let res = JSON.parse(uploadFileRes.data);
  496. if(res.code == 200){
  497. self.form.yhZghImg.push(res.data.url);
  498. }else{
  499. uni.showToast({
  500. title: res.msg,
  501. icon:"none",
  502. mask:true,
  503. duration: 2000
  504. });
  505. }
  506. },
  507. fail: err => {},
  508. complete: () => {
  509. uni.hideLoading()
  510. }
  511. });
  512. },
  513. //删除整改图片
  514. delZgImg(index){
  515. console.log("index",index)
  516. this.form.yhZghImg.splice(index,1);
  517. },
  518. //去整改
  519. async goUpData(type){
  520. let self = this;
  521. if(!self.form.zgMs && type!=4 && type!=2){
  522. uni.showToast({
  523. title: '请填写整改描述!',
  524. icon:"none",
  525. mask:true,
  526. duration: 2000
  527. });
  528. return
  529. }
  530. let obj = {
  531. id: self.details.id,
  532. checkId: self.details.checkId,
  533. yhZghImg: self.form.yhZghImg.join(','),
  534. zgMs: self.form.zgMs,
  535. spStatus:type,
  536. }
  537. const {data} = await editListUpdate(obj);
  538. if(data.code == 200){
  539. uni.showToast({
  540. title: '提交成功',
  541. icon:"none",
  542. mask:true,
  543. duration: 2000
  544. });
  545. setTimeout(function(){
  546. uni.navigateBack();
  547. },2000);
  548. }
  549. /* uni.navigateTo({
  550. url: '/pages_manage/workbench/problemRectification/rectifyInfo?newData='+encodeURIComponent(JSON.stringify(this.newData)),//未提交列表
  551. }); */
  552. },
  553. //查看报告按钮
  554. buttonChange(e){
  555. if(this.buttonArrayType == 1){
  556. if(e.target.value == 0){
  557. this.genNotice();
  558. }else if(e.target.value == 1){
  559. this.genReport();
  560. }
  561. }else if(this.buttonArrayType == 2){
  562. this.genNotice();
  563. }
  564. },
  565. genNotice(){
  566. uni.showLoading({
  567. title: '下载中'
  568. });
  569. wx.downloadFile({
  570. url: config.base_url+'/laboratory/checkOption/genNotice/' + this.newData.id,
  571. header: {
  572. Authorization: uni.getStorageSync('token')
  573. },
  574. success: function (res) {
  575. const fileManager = wx.getFileSystemManager()
  576. const filePath = wx.env.USER_DATA_PATH + '/整改通知书.docx'
  577. fileManager.saveFile({
  578. tempFilePath: res.tempFilePath,
  579. filePath,
  580. success: () => {
  581. uni.hideLoading();
  582. wx.openDocument({
  583. filePath: filePath,
  584. showMenu: true,
  585. fileType: 'docx'
  586. })
  587. },
  588. fail: function (res){
  589. uni.hideLoading();
  590. uni.showToast({
  591. title: '下载失败',
  592. icon:"none",
  593. mask:true,
  594. duration: 2000
  595. });
  596. }
  597. })
  598. },
  599. fail: function (res){
  600. uni.hideLoading();
  601. uni.showToast({
  602. title: '下载失败',
  603. icon:"none",
  604. mask:true,
  605. duration: 2000
  606. });
  607. }
  608. })
  609. },
  610. genReport(){
  611. uni.showLoading({
  612. title: '下载中'
  613. });
  614. wx.downloadFile({
  615. url: config.base_url+'/laboratory/checkOption/genReport/' + this.newData.id,
  616. header: {
  617. Authorization: uni.getStorageSync('token')
  618. },
  619. success: function (res) {
  620. const fileManager = wx.getFileSystemManager()
  621. const filePath = wx.env.USER_DATA_PATH + '/整改报告.docx'
  622. fileManager.saveFile({
  623. tempFilePath: res.tempFilePath,
  624. filePath,
  625. success: () => {
  626. uni.hideLoading();
  627. wx.openDocument({
  628. filePath: filePath,
  629. showMenu: true,
  630. fileType: 'docx'
  631. })
  632. },
  633. fail: function (res){
  634. uni.hideLoading();
  635. uni.showToast({
  636. title: '下载失败',
  637. icon:"none",
  638. mask:true,
  639. duration: 2000
  640. });
  641. }
  642. })
  643. },
  644. fail: function (res){
  645. uni.hideLoading();
  646. uni.showToast({
  647. title: '下载失败',
  648. icon:"none",
  649. mask:true,
  650. duration: 2000
  651. });
  652. }
  653. })
  654. },
  655. //详情开关
  656. infoClickButton(type){
  657. this.showType = !this.showType;
  658. },
  659. //查看图片
  660. lockImg(list){
  661. console.log(list)
  662. if(!list){
  663. return
  664. }
  665. /* let urlList=[];
  666. list=list.split(',')
  667. list.forEach(function(item2){
  668. urlList.push(config.base_url+item2)
  669. }) */
  670. wx.previewImage({
  671. urls:list, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  672. current: '', // 当前显示图片的http链接,默认是第一个
  673. success: function(res) {},
  674. fail: function(res) {},
  675. complete: function(res) {},
  676. })
  677. },
  678. //上传查看照片
  679. uploadLockImg(list){
  680. console.log(list)
  681. if(!list){
  682. return
  683. }
  684. let urlList=[];
  685. list=list.split(',')
  686. list.forEach(function(item2){
  687. urlList.push(config.base_url+item2)
  688. })
  689. wx.previewImage({
  690. urls:urlList, //需要预览的图片http链接列表,多张的时候,url直接写在后面就行了
  691. current: '', // 当前显示图片的http链接,默认是第一个
  692. success: function(res) {},
  693. fail: function(res) {},
  694. complete: function(res) {},
  695. })
  696. },
  697. async getInfo(){
  698. let obj = {
  699. id:this.id
  700. };
  701. const {data} = await RecordDettailsListNew(obj);
  702. console.log(22222)
  703. if(data.code==200){
  704. console.log(data.data)
  705. let obj = JSON.parse(JSON.stringify(data.data));
  706. let newOjb = obj.record;
  707. this.$set(this,'newData',newOjb);
  708. this.$set(this,'details',obj.details);
  709. let yhImg=[];
  710. let yhZghImg=[];
  711. if(obj.details.yhImg){
  712. yhImg=obj.details.yhImg.split(',');
  713. let urlList=[];
  714. yhImg.forEach(function(item2){
  715. urlList.push(config.base_url+item2)
  716. })
  717. this.details.yhImg=urlList
  718. }
  719. if(obj.details.yhZghImg){
  720. yhZghImg=obj.details.yhZghImg.split(',');
  721. let urlList=[];
  722. yhZghImg.forEach(function(item2){
  723. urlList.push(config.base_url+item2)
  724. })
  725. this.details.yhZghImg=urlList
  726. }
  727. if(this.details.detailslogList){
  728. this.details.detailslogList.forEach(function(item){
  729. if(item.yhImg){
  730. let list=[];
  731. let urlList=[];
  732. list=item.yhImg.split(',');
  733. list.forEach(function(item2){
  734. urlList.push(config.base_url+item2)
  735. })
  736. item.yhImg=urlList
  737. }
  738. if(item.yhZghImg){
  739. console.log(item.yhZghImg)
  740. let list=[];
  741. let urlList=[];
  742. list=item.yhZghImg.split(',');
  743. console.log(list)
  744. list.forEach(function(item2){
  745. console.log(item2)
  746. urlList.push(config.base_url+item2)
  747. console.log(urlList)
  748. })
  749. item.yhZghImg=urlList;
  750. }
  751. })
  752. console.log(this.details.detailslogList)
  753. }
  754. }
  755. /* if(data.code == 200){
  756. let obj = JSON.parse(JSON.stringify(data.data));
  757. for(let i=0;i<obj.yhlist.length;i++){
  758. let text = "";
  759. if(obj.yhlist[i].level1){
  760. text = text + obj.yhlist[i].level1;
  761. }
  762. if(obj.yhlist[i].level2){
  763. text = text + '/'+ obj.yhlist[i].level2;
  764. }
  765. if(obj.yhlist[i].level3){
  766. text = text + '/'+ obj.yhlist[i].level3;
  767. }
  768. if(obj.yhlist[i].level4){
  769. text = text + '/'+ obj.yhlist[i].level4;
  770. }
  771. obj.yhlist[i].level = text;
  772. if(obj.yhlist[i].yhImg){
  773. if(obj.yhlist[i].yhImg[i]){
  774. obj.yhlist[i].yhImg = obj.yhlist[i].yhImg.split(",");
  775. }
  776. }
  777. if(obj.yhlist[i].zmClImg){
  778. if(obj.yhlist[i].zmClImg[i]){
  779. obj.yhlist[i].zmClImg = obj.yhlist[i].zmClImg.split(",");
  780. }
  781. }
  782. if(obj.yhlist[i].yhZghImg){
  783. if(obj.yhlist[i].yhZghImg[i]){
  784. obj.yhlist[i].yhZghImg = obj.yhlist[i].yhZghImg.split(",");
  785. }
  786. }
  787. }
  788. let newOjb = obj.record;
  789. newOjb.detailsList = obj.yhlist;
  790. //判断悬浮按钮
  791. if(newOjb.zgType == 0){
  792. this.$set(this,'buttonArray',[])
  793. this.buttonArrayType = 4;
  794. }else if(newOjb.zgType == 1 && (newOjb.zgStatus == 1 || newOjb.zgStatus == 3 || newOjb.zgStatus == 4)){
  795. this.$set(this,'buttonArray',["整改通知书","整改报告"])
  796. this.buttonArrayType = 1;
  797. }else if(newOjb.zgType == 1 && (newOjb.zgStatus != 1 || newOjb.zgStatus != 3 || newOjb.zgStatus != 4)){
  798. this.$set(this,'buttonArray',["整改通知书"])
  799. this.buttonArrayType = 2;
  800. }
  801. this.$set(this,'newData',newOjb);
  802. }
  803. */
  804. },
  805. }
  806. }
  807. </script>
  808. <style lang="stylus" scoped>
  809. #rectifyDetails{
  810. height: 100%;
  811. width: 100%;
  812. display flex
  813. .info-max-page{
  814. flex:1;
  815. .position-button{
  816. position fixed
  817. right:0;
  818. top:214rpx;
  819. width:160rpx;
  820. height:60rpx;
  821. background #0183FA
  822. color:#fff;
  823. text-align center
  824. line-height:60rpx;
  825. font-size:26rpx;
  826. z-index:10;
  827. border-radius:50rpx 0 0 50rpx;
  828. }
  829. .top-info-box{
  830. background #fff
  831. margin:20rpx;
  832. padding:20rpx 20rpx 0;
  833. border-radius:20rpx;
  834. .top-min-info-box{
  835. line-height:66rpx;
  836. display:flex;
  837. font-size:28rpx;
  838. view:nth-child(1){
  839. width:220rpx;
  840. color:#999;
  841. }
  842. view:nth-child(2){
  843. flex:1;
  844. text-align right
  845. }
  846. }
  847. .top-info-button{
  848. border-top:1rpx solid #dedede;
  849. display:flex;
  850. line-height:98rpx;
  851. margin-top:20rpx;
  852. view{
  853. font-size:28rpx;
  854. margin-left:258rpx;
  855. color:#0183FA;
  856. }
  857. img{
  858. width:24rpx;
  859. height:12rpx;
  860. margin:45rpx 0 0 15rpx;
  861. }
  862. }
  863. }
  864. .bottom-info-box{
  865. .bottom-info-title-box{
  866. display flex;
  867. height:80rpx;
  868. margin:20rpx;
  869. img{
  870. width:32rpx;
  871. height:32rpx;
  872. margin:24rpx 15rpx 0 0;
  873. }
  874. view{
  875. line-height:80rpx;
  876. color:#333;
  877. font-size:30rpx;
  878. }
  879. }
  880. .bottom-info-text-box{
  881. display flex
  882. margin:20rpx;
  883. padding:36rpx 35rpx 36rpx 28rpx;
  884. background #fff
  885. border-radius:20rpx;
  886. view{
  887. font-size:28rpx;
  888. }
  889. view:nth-child(1){
  890. color:#999;
  891. width:140rpx;
  892. }
  893. view:nth-child(2){
  894. color:#666;
  895. flex:1;
  896. text-align left
  897. }
  898. }
  899. .rectified-max-box{
  900. .rectified-for-box{
  901. background #fff
  902. margin:20rpx;
  903. border-radius:20rpx;
  904. position relative
  905. overflow hidden
  906. .rectified-for-position-index{
  907. position absolute
  908. left:0;
  909. top:0;
  910. background #B4DBFF;
  911. color:#0183FA;
  912. width:50rpx;
  913. height:50rpx;
  914. text-align center;
  915. line-height:50rpx;
  916. font-size:34rpx;
  917. }
  918. .rectified-for-position-img{
  919. position absolute
  920. right:43rpx;
  921. top:105rpx;
  922. width:250rpx;
  923. height:220rpx;
  924. }
  925. .rectified-for-title{
  926. line-height:30rpx;
  927. font-size:30rpx;
  928. color:#333;
  929. margin:78rpx 30rpx 36rpx;
  930. }
  931. .rectified-for-name{
  932. margin:0 30rpx;
  933. line-height:40rpx;
  934. font-size:28rpx;
  935. padding-bottom:39rpx;
  936. color:#666;
  937. border-bottom:1rpx solid #E0E0E0;
  938. }
  939. .rectified-for-text-max-box{
  940. margin:38rpx 30rpx 0;
  941. .rectified-for-text-box{
  942. display flex
  943. margin-bottom :20rpx;
  944. view{
  945. font-size:28rpx;
  946. }
  947. view:nth-child(1){
  948. width:140rpx;
  949. color:#999;
  950. line-height 40rpx
  951. }
  952. view:nth-child(2){
  953. flex:1;
  954. color:#666;
  955. line-height 40rpx
  956. }
  957. }
  958. }
  959. .rectified-for-img-max-box{
  960. margin:35rpx 26rpx 40rpx;
  961. .rectified-for-img-box{
  962. margin-bottom :20rpx;
  963. display flex
  964. background #f0f0f0
  965. border-radius:10rpx;
  966. padding:10rpx 35rpx 10rpx 23rpx;
  967. img{
  968. width:80rpx;
  969. height:80rpx;
  970. margin-right:10rpx;
  971. }
  972. .rectified-for-img-min-text{
  973. flex:1;
  974. text-align right;
  975. line-height:80rpx;
  976. color:#0183FA;
  977. font-size:28rpx;
  978. }
  979. }
  980. /* 整改前照片 */
  981. .rectify_front{
  982. .rectify_front_t{
  983. width:150rpx;
  984. color:#999;
  985. line-height 40rpx
  986. font-size :28rpx;
  987. margin-bottom :24rpx;
  988. }
  989. .rectify_front_b{
  990. display :flex;
  991. justify-content :flex-start;
  992. flex-wrap: wrap;
  993. align-items :center;
  994. border-bottom: 1px solid #E0E0E0;
  995. >img{
  996. width: 200rpx;
  997. height: 200rpx;
  998. margin-right :14rpx;
  999. margin-bottom 40rpx;
  1000. border-radius :10rpx;
  1001. }
  1002. }
  1003. }
  1004. .rectify_info{
  1005. margin: 0;
  1006. padding: 0;
  1007. margin-top 40rpx;
  1008. margin-bottom :10rpx;
  1009. }
  1010. /* 整改后照片 */
  1011. .rectify_later{
  1012. .rectify_later_t{
  1013. width:150rpx;
  1014. color:#999;
  1015. line-height 40rpx
  1016. font-size :28rpx;
  1017. margin-bottom :24rpx;
  1018. }
  1019. .rectify_later_b{
  1020. display :flex;
  1021. justify-content :flex-start;
  1022. flex-wrap: wrap;
  1023. align-items :center;
  1024. >img{
  1025. width: 200rpx;
  1026. height: 200rpx;
  1027. margin-right :14rpx;
  1028. margin-bottom 40rpx;
  1029. border-radius :10rpx;
  1030. }
  1031. }
  1032. }
  1033. }
  1034. }
  1035. }
  1036. }
  1037. .info-bottom-button-box{
  1038. width:650rpx;
  1039. height:100rpx;
  1040. margin:50rpx auto;
  1041. color:#fff;
  1042. background:#0183FA;
  1043. text-align center;
  1044. line-height:100rpx;
  1045. border-radius:20rpx;
  1046. }
  1047. .info-bottom-button-box-two{
  1048. width:650rpx;
  1049. height:100rpx;
  1050. margin:50rpx auto;
  1051. color:#fff;
  1052. background:#999;
  1053. text-align center;
  1054. line-height:100rpx;
  1055. border-radius:20rpx;
  1056. }
  1057. .info-bottom-button-box-three{
  1058. display flex
  1059. width:650rpx;
  1060. height:100rpx;
  1061. margin:50rpx auto;
  1062. view{
  1063. text-align center
  1064. line-height:100rpx;
  1065. font-size:30rpx;
  1066. color:#fff;
  1067. }
  1068. view:nth-child(1){
  1069. width: 325rpx;
  1070. height: 100rpx;
  1071. background: linear-gradient(-45deg, #FA9901, #F28E26);
  1072. border-radius: 50rpx 0 0 50rpx;
  1073. }
  1074. view:nth-child(2){
  1075. width: 325rpx;
  1076. height: 100rpx;
  1077. background: linear-gradient(-35deg, #309CFF, #0183FA);
  1078. border-radius: 0 50rpx 50rpx 0;
  1079. }
  1080. }
  1081. /* 整改描述 */
  1082. .input-box{
  1083. //display flex
  1084. margin:32rpx 25rpx 0;
  1085. .text-p{
  1086. display:inline-block;
  1087. font-size:30rpx;
  1088. line-height:74rpx;
  1089. }
  1090. .bj-p{
  1091. display:inline-block;
  1092. font-size:30rpx;
  1093. line-height:74rpx;
  1094. color:#FF0000;
  1095. width:30rpx;
  1096. }
  1097. .textarea-p{
  1098. //width:658rpx;
  1099. height:212rpx;
  1100. padding:20rpx;
  1101. font-size:28rpx;
  1102. border:1rpx solid #dedede;
  1103. border-radius:20rpx;
  1104. }
  1105. }
  1106. /* 整改照片 */
  1107. .img-up-box{
  1108. //display flex
  1109. margin:32rpx 25rpx 0;
  1110. .text-p{
  1111. display :inline-block;
  1112. font-size:30rpx;
  1113. line-height:74rpx;
  1114. }
  1115. .bj-p{
  1116. display :inline-block;
  1117. font-size:30rpx;
  1118. line-height:74rpx;
  1119. color:#FF0000;
  1120. width:30rpx;
  1121. }
  1122. .img-box{
  1123. flex:1;
  1124. .up-img{
  1125. display: inline-block;
  1126. background url(@/images/icon_07.png) no-repeat
  1127. background-size 100%
  1128. width:200rpx;
  1129. height:200rpx;
  1130. overflow: hidden;
  1131. margin:0 10rpx 10rpx 0;
  1132. border-radius: 10rpx;
  1133. view{
  1134. font-size:28rpx;
  1135. text-align center;
  1136. color:#999;
  1137. line-height:30rpx;
  1138. margin-top:120rpx;
  1139. }
  1140. }
  1141. .min-for-img-box{
  1142. position relative
  1143. display: inline-block;
  1144. width:200rpx;
  1145. height:200rpx;
  1146. margin:0 10rpx 10rpx 0;
  1147. overflow hidden;
  1148. border-radius: 10rpx;
  1149. .min-for-img{
  1150. width:200rpx;
  1151. height:200rpx;
  1152. }
  1153. .del-img{
  1154. position absolute;
  1155. top:0rpx;
  1156. right:0rpx;
  1157. width:40rpx;
  1158. height:40rpx;
  1159. }
  1160. }
  1161. }
  1162. }
  1163. }
  1164. .input-max-box{
  1165. flex:1;
  1166. .input-box{
  1167. margin:20rpx;
  1168. background #fff
  1169. border-radius:20rpx;
  1170. display flex
  1171. overflow hidden
  1172. textarea{
  1173. width:610rpx;
  1174. height:212rpx;
  1175. margin:36rpx auto 47rpx;
  1176. font-size:28rpx;
  1177. padding:33rpx 24rpx;
  1178. border-radius:10rpx;
  1179. border: 2rpx solid #E0E0E0;
  1180. }
  1181. }
  1182. .input-button-box{
  1183. display flex
  1184. width:700rpx;
  1185. margin:50rpx auto;
  1186. .out-button{
  1187. flex:1;
  1188. text-align center
  1189. line-height:100rpx;
  1190. font-size:28rpx;
  1191. color:#fff;
  1192. background #999;
  1193. border-radius: 50rpx 0 0 50rpx;
  1194. }
  1195. .input-button{
  1196. flex:1;
  1197. text-align center
  1198. line-height:100rpx;
  1199. font-size:28rpx;
  1200. color:#fff;
  1201. background #0183FA;
  1202. border-radius: 0 50rpx 50rpx 0;
  1203. }
  1204. }
  1205. }
  1206. }
  1207. </style>