index.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. <template>
  2. <view class=" uni-container uni-container-bg">
  3. <view class="example container" :style="'height: ' + (screenHeight - wheight - 10) + 'px'">
  4. <view class="uni-padding-wrap uni-common-mt">
  5. <uni-segmented-control :current="current" :values="items" style-type="text"
  6. active-color="rgb(25, 146, 148)" @clickItem="onClickItem" />
  7. </view>
  8. <!-- <uni-row class="demo-uni-row align-center flex padding-tb-sm" :gutter="20" width="100%">
  9. <uni-col :span="12" class="flex flex-direction-row ">
  10. <text class="text-Width">开始时间:</text>
  11. <u-button customStyle="color: #2563EB;" plain shape="circle" size="small" color="#2563EB"
  12. @click="showtimeStart = true" :text="formData.start"></u-button>
  13. <u-datetime-picker :show="showtimeStart" :value="formData.start" mode="date" closeOnClickOverlay
  14. @confirm="confirmStarttime" @cancel="showtimeStart = false" @change="changetime"
  15. @close="showtimeStart = false">
  16. </u-datetime-picker>
  17. </uni-col>
  18. <uni-col :span="12" class="flex flex-direction-row ">
  19. <text class="text-Width">结束时间:</text>
  20. <u-button customStyle="color: #2563EB;" plain shape="circle" size="small" color="#2563EB"
  21. @click="showtimeEnd = true" :text="formData.end"></u-button>
  22. <u-datetime-picker :show="showtimeEnd" :value="formData.end" mode="date" closeOnClickOverlay
  23. @confirm="confirmEndtime" @cancel="showtimeEnd = false" @change="changetime"
  24. @close="showtimeEnd = false">
  25. </u-datetime-picker>
  26. </uni-col>
  27. </uni-row> -->
  28. <!-- 搜索 -->
  29. <!-- <uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
  30. <view class="" style="display: flex; align-items: center;">
  31. <uni-col :span="22">
  32. <view class="u-page__tag-item">
  33. <u-search v-model="keyword" :show-action="false"></u-search>
  34. </view>
  35. </uni-col>
  36. <uni-col :span='2'>
  37. <u-icon name="hourglass-half-fill" size="28" style='float: right;' @click='showSearch=true'>
  38. </u-icon>
  39. </uni-col>
  40. </view>
  41. </uni-row> -->
  42. <view v-if="current == 0">
  43. <view class="" style="margin-bottom: 100rpx;">
  44. <u-list @scrolltolower="scrolltolower">
  45. <u-list-item v-for="(item, index) in tableData" :key="index" link>
  46. <uni-row>
  47. <uni-col :span="2">
  48. <view class="" style="position: absolute;top: 0rpx;">
  49. <image :src="item.checked ?zhengchang:moren" class="tupian"
  50. @click="listItemChecked(item,index)">
  51. </image>
  52. </view>
  53. </uni-col>
  54. <uni-col :span="22">
  55. <view class="">
  56. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  57. <uni-col :span="18"
  58. class="text-xl font-weight-700">{{item.insp_name}}</uni-col>
  59. <uni-col :span="6" class="text-xl font-weight-700">
  60. <u-button size="mini" :color="'#ed7d31'">
  61. 未确认
  62. </u-button>
  63. </uni-col>
  64. </uni-row>
  65. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  66. <uni-col :span="24" class="text-2cut text-grey1 ">{{item.description}}
  67. </uni-col>
  68. </uni-row>
  69. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  70. <uni-col :span="18"
  71. class="text-cut text-grey1">巡查时间:{{item.inspect_time}}</uni-col>
  72. <uni-col :span="6" class="justify-end flex ">
  73. <!-- <u-button size="small"
  74. :color="item.status==='0'||item.status==='3'?'red':item.status==='1'?'green':'blue'"
  75. style="width: 160rpx;">{{statusListTran(item.status)}}</u-button> -->
  76. <u-button size="small" color="rgb(25, 146, 148)" style="width: 160rpx;"
  77. @click.native="onClick(item)">查看详情</u-button>
  78. </uni-col>
  79. </uni-row>
  80. </view>
  81. </uni-col>
  82. </uni-row>
  83. </u-list-item>
  84. </u-list>
  85. </view>
  86. <view class="review-button heigthButton">
  87. <u-button size="small" color="rgb(25, 146, 148)" :customStyle="btnGetCode" style="width: 280rpx;"
  88. @click.native="sureBtn">确认</u-button>
  89. </view>
  90. </view>
  91. <view v-else-if="current == 1">
  92. <view class="" style="margin-bottom: 100rpx;">
  93. <u-list @scrolltolower="scrolltolower">
  94. <u-list-item v-for="(item, index) in tableData" :key="index" link>
  95. <uni-row>
  96. <uni-col :span="2">
  97. <view class="" style="position: absolute;top: 0rpx;">
  98. <image :src="item.checked ?zhengchang:moren" class="tupian"
  99. @click="listItemChecked(item,index)">
  100. </image>
  101. </view>
  102. </uni-col>
  103. <uni-col :span="22">
  104. <view class="">
  105. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  106. <uni-col :span="18"
  107. class="text-xl font-weight-700">{{item.insp_name}}</uni-col>
  108. <uni-col :span="6" class="text-xl font-weight-700">
  109. <u-button size="mini" color="#ed7d31">
  110. 未处理
  111. </u-button>
  112. </uni-col>
  113. </uni-row>
  114. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  115. <uni-col :span="24" class="text-2cut text-grey1 ">{{item.description}}
  116. </uni-col>
  117. </uni-row>
  118. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  119. <uni-col :span="18" class="text-cut text-grey1">巡查时间:{{item.inspect_time}}
  120. </uni-col>
  121. <uni-col :span="6" class="justify-end flex ">
  122. <!-- <u-button size="small"
  123. :color="item.status==='0'||item.status==='3'?'red':item.status==='1'?'green':'blue'"
  124. style="width: 160rpx;">{{statusListTran(item.status)}}</u-button> -->
  125. <u-button size="small" color="rgb(25, 146, 148)" style="width: 160rpx;"
  126. @click.native="onClick(item)">查看详情</u-button>
  127. </uni-col>
  128. </uni-row>
  129. </view>
  130. </uni-col>
  131. </uni-row>
  132. </u-list-item>
  133. </u-list>
  134. </view>
  135. <view class="review-button heigthButton">
  136. <u-button size="small" color="rgb(25, 146, 148)" :customStyle="btnGetCode" style="width: 280rpx;"
  137. @click.native="reviewBtn">复 查</u-button>
  138. </view>
  139. </view>
  140. <view v-else-if="current == 2">
  141. <view class="" style="margin-bottom: 100rpx;">
  142. <u-list @scrolltolower="scrolltolower">
  143. <u-list-item v-for="(item, index) in tableData" :key="index" link>
  144. <uni-row>
  145. <!-- <uni-col :span="2">
  146. <view class="" style="position: absolute;top: 0rpx;" v-if="item.denger_status==0">
  147. <image :src="item.checked ?zhengchang:moren" class="tupian"
  148. @click="listItemChecked(item,index)">
  149. </image>
  150. </view>
  151. </uni-col> -->
  152. <uni-col :span="22">
  153. <view class="">
  154. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  155. <uni-col :span="18"
  156. class="text-xl font-weight-700">{{item.insp_name}}</uni-col>
  157. <uni-col :span="6" class="text-xl font-weight-700">
  158. <!-- <u-button size="mini" :color="item.denger_status=='0'?'#ed7d31':'#aace99'">
  159. {{ item.denger_status=='0'?'未处理':'已处理'}}
  160. </u-button> -->
  161. <u-button size="mini" color="#aace99">
  162. 已处理
  163. </u-button>
  164. </uni-col>
  165. </uni-row>
  166. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  167. <uni-col :span="24" class="text-2cut text-grey1 ">{{item.description}}
  168. </uni-col>
  169. </uni-row>
  170. <uni-row class="demo-uni-row " :gutter="20" width="100%">
  171. <uni-col :span="18"
  172. class="text-cut text-grey1">巡查时间:{{item.inspect_time}}</uni-col>
  173. <uni-col :span="6" class="justify-end flex ">
  174. <!-- <u-button size="small"
  175. :color="item.status==='0'||item.status==='3'?'red':item.status==='1'?'green':'blue'"
  176. style="width: 160rpx;">{{statusListTran(item.status)}}</u-button> -->
  177. <u-button size="small" color="rgb(25, 146, 148)" style="width: 160rpx;"
  178. @click.native="onClick(item)">查看详情</u-button>
  179. </uni-col>
  180. </uni-row>
  181. </view>
  182. </uni-col>
  183. </uni-row>
  184. </u-list-item>
  185. </u-list>
  186. </view>
  187. </view>
  188. </view>
  189. <!-- 搜索框 -->
  190. <u-popup :show="showSearch" :round="20" mode="bottom" @close="close" @open="open">
  191. <view class="searchpopup">
  192. <u--form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
  193. labelPosition="left" label-width="68px">
  194. <u-form-item label="处理结果" prop="handleResult">
  195. <u--input v-model="queryParams.handleResult" placeholder="请输入处理结果" clearable
  196. @keyup.enter.native="handleQuery" />
  197. </u-form-item>
  198. <u-form-item label="解决方式" prop="handleMethod">
  199. <u-radio-group v-model="queryParams.handleMethod">
  200. <u-radio :customStyle="{marginRight: '16px'}" v-for="dict in dengerHandle" :key="dict.value"
  201. :label="dict.label" :name="dict.value">
  202. </u-radio>
  203. </u-radio-group>
  204. </u-form-item>
  205. <u-form-item>
  206. <u-button @click="showSearch=false">取消</u-button>
  207. <u-button type="primary" color="rgb(25, 146, 148)" @click="handleQuery">搜索</u-button>
  208. </u-form-item>
  209. </u--form>
  210. </view>
  211. </u-popup>
  212. <u-modal title="隐患复查" width="640rpx" :show="showreview " showCancelButton buttonReverse @confirm="onreviewclick"
  213. @cancel="cancelClick" confirmColor="rgb(25, 146, 148)">
  214. <view class="" style="width: 100%;">
  215. <u--form :model="reviewFromdata" ref="reviewfrom" label-width='95px'>
  216. <u-form-item label="解决方式:" prop="handleMethod">
  217. <u-radio-group v-model="reviewFromdata.handleMethod">
  218. <u-radio :customStyle="{marginRight: '16px'}" activeColor="rgb(25, 146, 148)"
  219. v-for="dict in dengerHandle" :key="dict.value" :label="dict.label" :name="dict.value">
  220. </u-radio>
  221. </u-radio-group>
  222. </u-form-item>
  223. <!-- <u-form-item label="是否上报:" prop="isReport">
  224. <u-radio-group v-model="reviewFromdata.isReport">
  225. <u-radio :customStyle="{marginRight: '16px'}" activeColor="rgb(25, 146, 148)"
  226. v-for="dict in isReportList" :key="dict.value" :label="dict.label" :name="dict.value">
  227. </u-radio>
  228. </u-radio-group>
  229. </u-form-item> -->
  230. <u-form-item label="截止日期:" prop="handleTime" @click="showHandleTime = true; hideKeyboard()">
  231. <u--input v-model="reviewFromdata.handleTime" :disabled="true" disabledColor="#ffffff"
  232. suffixIcon="calendar" suffixIconStyle="color: #909399">
  233. </u--input>
  234. </u-form-item>
  235. <u-form-item label="复查人员:" @click="
  236. showOrg = true;showHandleTime = false
  237. hideKeyboard()" prop="receiverName">
  238. <u-input border="none" disabled v-model="reviewFromdata.receiverName" style="padding:18rpx"
  239. placeholder="请选择复查人员"></u-input>
  240. </u-form-item>
  241. <!-- <swiperl :list="list5" @change="e => current = e.current" :autoplay="false" previousMargin="60"
  242. nextMargin="60" circular radius="5" bgColor="#ffffff" @click="swiperClick">
  243. <view slot="indicator" class="indicator">
  244. <view class="indicator__dot" v-for="(item, index) in list5" :key="index"
  245. :class="[index === current && 'indicator__dot--active']">
  246. </view>
  247. </view>
  248. </swiperl> -->
  249. </u--form>
  250. </view>
  251. </u-modal>
  252. <u-action-sheet :show="showOrg" :actions="list5" title="请选择复查人员" @close="showOrg = false" @select="sexSelect">
  253. </u-action-sheet>
  254. <u-datetime-picker :show="showHandleTime" v-model="time" mode="date" closeOnClickOverlay
  255. @confirm="confirmReviewTime" @cancel="showHandleTime = false" @change="changeReviewTime"
  256. @close="showHandleTime = false">
  257. </u-datetime-picker>
  258. <!-- 加载中 -->
  259. <isLodingModel></isLodingModel>
  260. </view>
  261. </template>
  262. <script>
  263. let that = null;
  264. import {
  265. getPageDenger, // 历史记录隐患记录
  266. } from "@/api/historical_record";
  267. import {
  268. getSelfEmp, // 获取本单位下的人员信息
  269. dangeRreview, // 隐患复查
  270. batchSetDangerStatus
  271. } from "@/api/hiddenTrouble";
  272. import {
  273. DICT_TYPE,
  274. getDictDatas
  275. } from "@/utils/dict";
  276. import swiperl from "@/components/swiper/swiper.vue"
  277. import {
  278. shijianc
  279. } from '@/utils/common.js'
  280. import config from '@/config'
  281. const baseUrlImg = config.baseUrlImg
  282. export default {
  283. components: {
  284. swiperl
  285. },
  286. data() {
  287. return {
  288. screenHeight: this.$screenHeight,
  289. wheight: '',
  290. items: ['隐患确认', '待复查', '已处理'],
  291. current: 0,
  292. moren: `${baseUrlImg}/checkActive/moren.png`, //默认图片
  293. zhengchang: `${baseUrlImg}/checkActive/zhengchang.png`,
  294. photograph: `${baseUrlImg}/checkActive/photograph.png`,
  295. btnGetCode: {
  296. width: '280rpx', // 注意驼峰命名,并且值必须用引号包括,因为这是对象
  297. },
  298. // 数据
  299. tableData: [],
  300. // 每页数据量
  301. pageSize: 20,
  302. // 当前页
  303. pageNo: 1,
  304. // 数据总量
  305. total: 0,
  306. // tableData数据加载中
  307. loading: false,
  308. showOrg: false,
  309. // 初始化时搜索框的值
  310. keyword: '',
  311. // 开始时间与结束时间
  312. formData: {
  313. start: '请选择开始时间',
  314. end: '请选择结束时间',
  315. },
  316. showtimeStart: false,
  317. showtimeEnd: false,
  318. statusList: {
  319. 0: "未解决",
  320. 1: "已解决",
  321. 2: "审核中",
  322. 3: "审核未通过"
  323. },
  324. // 搜索框显示控制
  325. showSearch: false,
  326. // 查询参数
  327. queryParams: {
  328. pageNo: 1,
  329. pageSize: 10,
  330. dengerStatus: 0,
  331. handleResult: null,
  332. handleTime: [],
  333. status: 0,
  334. handleMethod: null,
  335. orgId: null,
  336. userId: null,
  337. },
  338. dengerHandle: getDictDatas(DICT_TYPE.DENGER_HANDLE),
  339. // =========================================
  340. time: Number(new Date()),
  341. reviewFromdata: {
  342. broadId: 0,
  343. dangerMapList: [],
  344. handleMethod: "",
  345. handleResult: "",
  346. handleTime: "",
  347. orgId: 0,
  348. receiver: "",
  349. sender: 0,
  350. isReport: "",
  351. receiverName: ""
  352. },
  353. isReportList: [{
  354. value: 0,
  355. label: "否"
  356. }, {
  357. value: 1,
  358. label: "是"
  359. }],
  360. showHandleTime: false,
  361. showreview: false,
  362. list5: [],
  363. current: 0,
  364. currentChecked: false,
  365. dangerIdStatus: {
  366. "dangerIds": [],
  367. "dangerStatus": 1
  368. }, //点击确认
  369. dangerIds: [],
  370. rules: {
  371. 'handleMethod': {
  372. // type: 'string',
  373. required: true,
  374. message: '请选择解决方式',
  375. trigger: ['blur', 'change']
  376. },
  377. // 'isReport': {
  378. // // type: 'string',
  379. // required: true,
  380. // message: '请选择是否上报',
  381. // trigger: ['blur', 'change']
  382. // },
  383. 'handleTime': {
  384. // type: 'string',
  385. required: true,
  386. message: '请选择截止日期',
  387. trigger: ['blur', 'change']
  388. },
  389. 'receiverName': {
  390. // type: 'string',
  391. required: true,
  392. message: '请选择复查人员',
  393. trigger: ['blur', 'change']
  394. },
  395. },
  396. }
  397. },
  398. // 在 vue页面,向起始页通过事件传递数据
  399. onLoad: function(option) {
  400. },
  401. onShow() {
  402. this.$nextTick(() => {
  403. uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
  404. this.wheight = data.height
  405. }).exec()
  406. })
  407. this.tableData = []
  408. this.getData(1)
  409. },
  410. mixins: [uni.$u.mixin],
  411. watch: {
  412. loading: {
  413. handler(newLength, oldLength) {
  414. this.$modal.isLoadingModel(this.loading)
  415. },
  416. immediate: true
  417. },
  418. // this.$refs.uForm.setRules(this.rules);
  419. showreview: {
  420. handler(value) {
  421. this.$nextTick(() => { //在弹窗加载出来只有 show 才会变成 true
  422. if (value == true) { //判断 弹窗 v-model 变成 true 的时候去加载规则。 原理:在弹窗渲染完成之后表单渲染完成之前去加载规则就不会报错了
  423. // 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
  424. this.$refs.reviewfrom.setRules(this.rules);
  425. }
  426. })
  427. },
  428. immediate: true, // 重点
  429. deep: true, // 重点
  430. },
  431. },
  432. methods: {
  433. cancelClick() {
  434. this.list5=[]
  435. this.showOrg = false
  436. this.showreview = false
  437. },
  438. // tab头部点击
  439. onClickItem(e) {
  440. if (this.current !== e.currentIndex) {
  441. this.current = e.currentIndex;
  442. }
  443. this.queryParams.dengerStatus = e.currentIndex == 2 ? 2 : (e.currentIndex == 0 ? 0 : 1)
  444. this.tableData = []
  445. this.getData(1)
  446. this.dangerIds = []
  447. },
  448. hideKeyboard() {
  449. uni.hideKeyboard()
  450. },
  451. // =================数据转换==================
  452. statusListTran(val) { //status状态转换
  453. return this.statusList[val]
  454. },
  455. // ================================
  456. // 获取数据
  457. getData(pageNo, value = '') {
  458. this.queryParams.orgId = this.$store.state.user.orgId
  459. this.queryParams.userId = this.$store.state.user.id
  460. this.loading = true
  461. this.queryParams.pageNo = pageNo
  462. getPageDenger(this.queryParams).then(response => {
  463. // 为数据赋值:通过展开运算符的形式,进行新旧数据的拼接
  464. this.tableData = [...this.tableData, ...response.data.list]
  465. // this.tableData = response.data.list;
  466. this.total = response.data.total;
  467. this.loading = false;
  468. this.tableData.map(i => {
  469. i.checked = false
  470. i.inspect_time = shijianc(i.inspect_time)
  471. })
  472. });
  473. },
  474. onClick(val) {
  475. if (val.insp_type == 'fpd') {
  476. uni.navigateTo({
  477. url: '/pagesA/fire/hidden_trouble/trouble_xf_deetails/trouble_xf_deetails?id=' + val.id,
  478. })
  479. } else {
  480. uni.navigateTo({
  481. url: '/pagesA/fire/hidden_trouble/trouble_details/trouble_details?id=' + val.id,
  482. })
  483. }
  484. },
  485. // 触底的事件
  486. scrolltolower() {
  487. // 判断是否还有下一页数据
  488. if (this.queryParams.pageNo * this.queryParams.pageSize >= this.total) return
  489. // 判断是否正在请求其它数据,如果是,则不发起额外的请求
  490. if (this.loading) return
  491. this.pageNo += 1
  492. this.getData(this.pageNo)
  493. },
  494. //日期范围
  495. // 开始日期
  496. confirmStarttime(e) {
  497. this.showtimeStart = false
  498. let value = new Date(e.value)
  499. this.formData.start = uni.$u.timeFormat(e.value, 'yyyy/mm/dd');
  500. },
  501. changetime(e) {
  502. },
  503. confirmEndtime(e) {
  504. this.showtimeEnd = false
  505. let value = new Date(e.value)
  506. this.formData.end = uni.$u.timeFormat(e.value, 'yyyy/mm/dd');
  507. },
  508. // 搜索框
  509. open(e) {
  510. },
  511. close(e) {
  512. this.showSearch = false
  513. },
  514. /** 搜索按钮操作 */
  515. handleQuery() {
  516. this.showSearch = false
  517. this.queryParams.pageNo = 1
  518. this.getData(this.queryParams.pageNo)
  519. },
  520. // ===搜索框结束=============================
  521. // =====复选框====================================
  522. restReviewform() {
  523. this.reviewFromdata = {
  524. broadId: 0,
  525. dangerMapList: [],
  526. handleMethod: "",
  527. handleResult: "",
  528. handleTime: "",
  529. orgId: 0,
  530. receiver: 0,
  531. sender: 0,
  532. }
  533. },
  534. sexSelect(e) {
  535. this.reviewFromdata.receiver = e.id;
  536. this.reviewFromdata.receiverName = e.name;
  537. },
  538. confirmReviewTime(e) {
  539. var time = uni.$u.timeFormat(e.value, 'yyyy-mm-dd');
  540. this.reviewFromdata.handleTime = time
  541. this.showHandleTime = false
  542. // this.list5=[]
  543. },
  544. changeReviewTime(e) {
  545. },
  546. listItemChecked(val, index) {
  547. this.tableData[index].checked = !this.tableData[index].checked
  548. this.dangerIds.push(val.id)
  549. this.$forceUpdate()
  550. // val.checked=!val.checked
  551. },
  552. sureBtn() { //确认
  553. this.current = 1
  554. this.dangerIdStatus.dangerStatus = 1
  555. this.dangerIdStatus.dangerIds = Array.from(new Set(this.dangerIds)) //去重
  556. batchSetDangerStatus(JSON.stringify(this.dangerIdStatus)).then(res => {
  557. if (res.data) {
  558. this.current = 1
  559. this.queryParams.dengerStatus = 1
  560. this.tableData=[]
  561. this.getData(1)
  562. }
  563. })
  564. },
  565. reviewBtn() {
  566. let list = this.tableData
  567. let checedkList = list.filter(i => i.checked == true)
  568. if (checedkList.length == 0) {
  569. this.$modal.msgError('请先选择隐患')
  570. return
  571. }
  572. const newArr = checedkList.map(item => item.orgId);
  573. const isRepeat = Array.from(new Set(newArr)) //去重
  574. if (isRepeat.length > 1) {
  575. this.$modal.msgError('单位所属不一致')
  576. return
  577. }
  578. getSelfEmp({
  579. orgId: isRepeat[0]
  580. }).then(response => {
  581. this.showreview = true,
  582. // this.list5 = response.data;
  583. response.data.map(i => {
  584. this.list5.push({
  585. id: i.accountId,
  586. name: i.empRyxm
  587. });
  588. // i.title = i.empRyxm
  589. // i.image = i.image ? i.image : ''
  590. })
  591. // this.list5 = response.data;
  592. });
  593. },
  594. onreviewclick() {
  595. let list = this.tableData
  596. let checedkList = list.filter(i => i.checked == true)
  597. if (checedkList.length == 0) {
  598. this.$modal.msgError('请先选择隐患')
  599. return
  600. }
  601. const newArr = checedkList.map(item => item.orgId);
  602. const isRepeat = Array.from(new Set(newArr)) //去重
  603. if (isRepeat.length > 1) {
  604. this.$modal.msgError('单位所属不一致')
  605. return
  606. }
  607. var dangerMapList = []
  608. checedkList.map(i => {
  609. dangerMapList.push({
  610. id: i.id,
  611. insp_id: i.insp_id,
  612. org_id: i.org_id,
  613. task_id: i.task_id,
  614. broad_id: i.broad_id
  615. })
  616. })
  617. this.reviewFromdata.broadId = checedkList[0].broad_id //后端返回的checedkList中的broad_id都相同,取任意一个就行
  618. this.reviewFromdata.dangerMapList = dangerMapList
  619. this.reviewFromdata.orgId = isRepeat[0]
  620. // this.reviewFromdata.receiver = this.list5[this.current].accountId
  621. this.reviewFromdata.sender = this.$store.state.user.id
  622. // 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
  623. this.$refs.reviewfrom.validate().then(res => {
  624. // uni.$u.toast('校验通过')
  625. dangeRreview(this.reviewFromdata).then(response => {
  626. if (response.data) this.$modal.msgSuccess('修改成功')
  627. this.showreview = false
  628. this.list5 = []
  629. this.restReviewform()
  630. this.tableData = []
  631. this.getData(1)
  632. });
  633. }).catch(errors => {
  634. // uni.$u.toast('校验失败')/
  635. })
  636. },
  637. swiperClick(e) {
  638. }
  639. }
  640. }
  641. </script>
  642. <style scoped lang="scss">
  643. ::v-deep .u-list-item {
  644. transition: border linear .2s, box-shadow linear .5s;
  645. -moz-transition: border linear .2s, -moz-box-shadow linear .5s;
  646. -webkit-transition: border linear .2s, -webkit-box-shadow linear .5s;
  647. outline: none;
  648. border-color: rgba(86, 165, 168, 0.4);
  649. box-shadow: 0 0 8px rgba(93, 149, 242, .105);
  650. -moz-box-shadow: 0 0 8px rgba(93, 149, 242, .5);
  651. -webkit-box-shadow: 0 0 8px rgb(86, 165, 168);
  652. }
  653. .addInsp {
  654. width: 40px;
  655. position: fixed;
  656. right: 4px;
  657. z-index: 99999;
  658. }
  659. ::v-deep .u-icon__icon {
  660. margin-right: 0px !important;
  661. }
  662. .searchpopup {
  663. height: 60vh;
  664. display: flex;
  665. justify-content: center;
  666. padding: 20rpx
  667. }
  668. .tupian {
  669. width: 48rpx;
  670. height: 48rpx;
  671. }
  672. .review-button {
  673. position: fixed;
  674. bottom: 0rpx;
  675. width: 100%;
  676. background: #F5F7F9;
  677. height: 100rpx;
  678. display: flex;
  679. align-items: center;
  680. }
  681. /deep/.u-action-sheet {
  682. overflow-y: auto;
  683. height: 1000rpx;
  684. background-color: #fff;
  685. }
  686. /deep/.u-action-sheet {
  687. overflow-y: auto;
  688. height: 1000rpx;
  689. background-color: #fff;
  690. }
  691. .example {
  692. overflow-y: auto;
  693. }
  694. </style>