dangerareachecklist.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. <!--
  2. * @Title:
  3. * @Description: 转移人员清单
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="wrap">
  11. <uni-nav-bar dark :fixed="true" backgroundColor="#3F9EFF" statusBar="false" left-icon="left" left-text="返回"
  12. @clickLeft="toBack">
  13. <view class="nav-title">
  14. <text>{{title}}</text>
  15. </view>
  16. </uni-nav-bar>
  17. <view class="container">
  18. <view v-if="type==1">
  19. <uni-collapse @change="searchAreaStatus">
  20. <uni-collapse-item :show-animation="true" :open="true">
  21. <template v-slot:title>
  22. <view class="view-flex-block-center" style="height: 40px;width: 100%;">
  23. <view class="view-flex-inline-center">
  24. <text v-if="showSearch" style="color: coral;font-size: 1rem;">点击收起查询区</text>
  25. <text v-else style="color: coral;font-size: 1rem;">点击展开查询区</text>
  26. </view>
  27. </view>
  28. </template>
  29. </uni-collapse-item>
  30. </uni-collapse>
  31. <view v-if="showSearch" class="search-block">
  32. <view style="padding-left: 10px;padding-right: 10px;margin-top: 10px;">
  33. <view>
  34. <uni-data-select v-model="cityRegionValue" :localdata="cityRegionData"
  35. @change="cityRegionChange" :clear="false" placeholder="请选择盟市"></uni-data-select>
  36. </view>
  37. <view style="margin-top: 10px;">
  38. <uni-data-select v-model="districtRegionValue" :localdata="districtRegionData"
  39. @change="districtRegionChange" placeholder="请选择区旗县"></uni-data-select>
  40. </view>
  41. <view style="margin-top: 10px;">
  42. <uni-data-select v-model="townRegionValue" :localdata="townRegionData"
  43. @change="townRegionChange" placeholder="请选择乡镇"></uni-data-select>
  44. </view>
  45. <view style="margin-top: 10px;">
  46. <uni-data-select v-model="countryRegionValue" :localdata="countryRegionData"
  47. @change="countryRegionChange" placeholder="请选择村"></uni-data-select>
  48. </view>
  49. <view style="margin-top: 10px;">
  50. <uni-data-select v-model="dangerAreaValue" :localdata="dangerAreaData"
  51. @change="dangerAreaChange" placeholder="请选择危险区"></uni-data-select>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view v-if="list.length>0">
  57. <uni-list>
  58. <uni-list-item v-for="item in list" :key="item.id">
  59. <template v-slot:body>
  60. <view class="list-item-block">
  61. <view v-if="item.checkType == 1" class="line">
  62. <text class="content" style="color: blue;">独立巡查</text>
  63. </view>
  64. <view v-else class="line">
  65. <text class="content" style="color: blue;">应急发起巡查</text>
  66. </view>
  67. <view class="line">
  68. <text class="content">巡查时间:{{item.createTime}}</text>
  69. </view>
  70. <view class="line">
  71. <text class="content text-ellipsis">行政区:{{item.adName}}</text>
  72. </view>
  73. <view class="line">
  74. <text class="content text-ellipsis">危险区:{{item.dangerAreaName}}</text>
  75. </view>
  76. <view v-if="item.isFlood == 0" class="line">
  77. <text class="content">是否有山洪:否</text>
  78. </view>
  79. <view v-else class="line">
  80. <text class="content">是否有山洪:有</text>
  81. </view>
  82. <view v-if="item.isDamage == 0" class="line">
  83. <text class="content">是否成灾:否</text>
  84. </view>
  85. <view v-else class="line">
  86. <text class="content">是否成灾:是</text>
  87. </view>
  88. <view v-if="item.isWarn == 0" class="line">
  89. <text class="content">是否预警:否</text>
  90. </view>
  91. <view v-else class="line">
  92. <text class="content">是否预警:是</text>
  93. </view>
  94. <view v-if="item.isTransfer == 0" class="line">
  95. <text class="content">是否转移:否</text>
  96. </view>
  97. <view v-else class="line">
  98. <text class="content">是否转移:是</text>
  99. </view>
  100. <!-- <view class="line">
  101. <text class="content text-ellipsis">备注:{{item.remark}}</text>
  102. </view> -->
  103. <view class="item-button-group" style="padding-right: 10px;">
  104. <!-- <view class="item-button mid-size" @click="onCheckPhotoClick(item)">
  105. <view class="items-line">
  106. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  107. <text class="button-text">查看图片</text>
  108. </view>
  109. </view> -->
  110. <view class="item-button mid-size" @click="onCheckPhotoClick(item)">
  111. <view class="items-line">
  112. <uni-icons class="input-uni-icon" type="location" size="18" color="coral" />
  113. <text class="button-text">查看详情</text>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </template>
  119. </uni-list-item>
  120. </uni-list>
  121. <uni-group>
  122. <view class="pagination-block">
  123. <uni-pagination show-icon :pageSize="pageSize" :current="pageCurrent" :total="total"
  124. @change="pageChange" />
  125. </view>
  126. </uni-group>
  127. </view>
  128. <view v-else class="view-flex-inline-center">
  129. <view style="margin-top: 10px;color: gray;font-size: 1rem;">暂无数据</view>
  130. </view>
  131. </view>
  132. </view>
  133. </template>
  134. <script>
  135. import http from '@/http/api.js';
  136. export default {
  137. components: {},
  138. data() {
  139. return {
  140. title: '巡查信息',
  141. showSearch: true,
  142. cityRegionValue: '',
  143. cityRegionData: [],
  144. districtRegionValue: '',
  145. districtRegionData: [],
  146. townRegionValue: '',
  147. townRegionData: [],
  148. countryRegionValue: '',
  149. countryRegionData: [],
  150. dangerAreaValue: '',
  151. dangerAreaData: [],
  152. pageSize: 10,
  153. pageCurrent: 1,
  154. total: 0,
  155. list: [],
  156. query: {},
  157. type: 1,
  158. warnId: '',
  159. }
  160. },
  161. computed: {},
  162. onLoad(option) {
  163. this.type = option.type;
  164. this.query = {};
  165. if (this.type == 1) {
  166. this.getCityRegion({});
  167. } else if (this.type == 2) {
  168. this.warnId = option.warnId;
  169. this.query['warnId'] = this.warnId;
  170. }
  171. },
  172. onShow() {
  173. this.pageCurrent = 1;
  174. this.getPage();
  175. },
  176. methods: {
  177. //返回上一页
  178. toBack() {
  179. uni.navigateBack({
  180. delta: 1
  181. })
  182. },
  183. searchAreaStatus(e) {
  184. if (e.length > 0) {
  185. this.showSearch = true;
  186. } else {
  187. this.showSearch = false;
  188. }
  189. },
  190. cityRegionChange(e) {
  191. this.cityRegionValue = e;
  192. this.districtRegionData = [];
  193. this.districtRegionValue = '';
  194. this.townRegionData = [];
  195. this.townRegionValue = '';
  196. this.countryRegionData = [];
  197. this.countryRegionValue = '';
  198. this.dangerAreaData = [];
  199. this.dangerAreaValue = '';
  200. let p = {
  201. 'parentCode': this.cityRegionValue
  202. }
  203. this.getDistrictRegion(p);
  204. this.query['adcd'] = this.cityRegionValue;
  205. this.pageCurrent = 1;
  206. this.list = [];
  207. this.getPage({});
  208. },
  209. districtRegionChange(e) {
  210. if (e == undefined || e == null || e == '') {
  211. this.districtRegionValue = '';
  212. this.townRegionData = [];
  213. this.townRegionValue = '';
  214. this.countryRegionData = [];
  215. this.countryRegionValue = '';
  216. this.dangerAreaData = [];
  217. this.dangerAreaValue = '';
  218. this.query['adcd'] = this.cityRegionValue;
  219. this.pageCurrent = 1;
  220. this.list = [];
  221. this.getPage({});
  222. } else {
  223. this.districtRegionValue = e;
  224. this.townRegionData = [];
  225. this.townRegionValue = '';
  226. this.countryRegionData = [];
  227. this.countryRegionValue = '';
  228. this.dangerAreaData = [];
  229. this.dangerAreaValue = '';
  230. let p = {
  231. 'parentCode': this.districtRegionValue
  232. }
  233. this.getTownRegion(p);
  234. this.query['adcd'] = this.districtRegionValue;
  235. this.pageCurrent = 1;
  236. this.list = [];
  237. this.getPage({});
  238. }
  239. },
  240. townRegionChange(e) {
  241. if (e == undefined || e == null || e == '') {
  242. this.townRegionValue = '';
  243. this.countryRegionData = [];
  244. this.countryRegionValue = '';
  245. this.dangerAreaData = [];
  246. this.dangerAreaValue = '';
  247. this.query['adcd'] = this.districtRegionValue;
  248. this.pageCurrent = 1;
  249. this.list = [];
  250. this.getPage({});
  251. } else {
  252. this.townRegionValue = e;
  253. this.countryRegionData = [];
  254. this.countryRegionValue = '';
  255. this.dangerAreaData = [];
  256. this.dangerAreaValue = '';
  257. let p = {
  258. 'parentCode': this.townRegionValue
  259. }
  260. this.getCountryRegion(p);
  261. this.query['adcd'] = this.townRegionValue;
  262. this.pageCurrent = 1;
  263. this.list = [];
  264. this.getPage({});
  265. }
  266. },
  267. countryRegionChange(e) {
  268. if (e == undefined || e == null || e == '') {
  269. this.countryRegionValue = '';
  270. this.dangerAreaValue = '';
  271. this.dangerAreaData = [];
  272. this.query['adcd'] = this.townRegionValue;
  273. this.pageCurrent = 1;
  274. this.list = [];
  275. this.getPage({});
  276. } else {
  277. this.countryRegionValue = e;
  278. this.dangerAreaValue = '';
  279. this.dangerAreaData = [];
  280. this.query['adcd'] = this.countryRegionValue;
  281. this.getDangerAreaList({})
  282. this.pageCurrent = 1;
  283. this.list = [];
  284. this.getPage({});
  285. }
  286. },
  287. dangerAreaChange(e) {
  288. if (e == undefined || e == null || e == '') {
  289. this.dangerAreaValue = '';
  290. this.pageCurrent = 1;
  291. this.list = [];
  292. this.getPage({});
  293. } else {
  294. this.dangerAreaValue = e;
  295. this.pageCurrent = 1;
  296. this.list = [];
  297. this.getPage({
  298. dangerAreaPid: this.dangerAreaValue
  299. });
  300. }
  301. },
  302. getCityRegion(params = {}) {
  303. let that = this;
  304. http.request({
  305. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  306. method: 'GET',
  307. data: params,
  308. }).then(res => {
  309. that.cityRegionData = res.data.map(item => {
  310. return {
  311. value: item.adcd,
  312. text: item.adnm,
  313. }
  314. })
  315. }).catch(err => {
  316. console.log(err)
  317. })
  318. },
  319. getDistrictRegion(params = {}) {
  320. let that = this;
  321. http.request({
  322. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  323. method: 'GET',
  324. data: params,
  325. }).then(res => {
  326. that.districtRegionData = res.data.map(item => {
  327. return {
  328. value: item.adcd,
  329. text: item.adnm,
  330. }
  331. })
  332. }).catch(err => {
  333. console.log(err)
  334. })
  335. },
  336. getTownRegion(params = {}) {
  337. let that = this;
  338. http.request({
  339. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  340. method: 'GET',
  341. data: params,
  342. }).then(res => {
  343. that.townRegionData = res.data.map(item => {
  344. return {
  345. value: item.adcd,
  346. text: item.adnm,
  347. }
  348. })
  349. }).catch(err => {
  350. console.log(err)
  351. })
  352. },
  353. getCountryRegion(params = {}) {
  354. let that = this;
  355. http.request({
  356. url: '/galaxy-business/baseinfo/region/whole/yj/list',
  357. method: 'GET',
  358. data: params,
  359. }).then(res => {
  360. that.countryRegionData = res.data.map(item => {
  361. return {
  362. value: item.adcd,
  363. text: item.adnm,
  364. }
  365. })
  366. }).catch(err => {
  367. console.log(err)
  368. })
  369. },
  370. getDangerAreaList(params = {}) {
  371. let postData = Object.assign(params, this.query);
  372. let that = this;
  373. http.request({
  374. url: '/galaxy-business/map/dangerarea/select',
  375. method: 'GET',
  376. data: postData,
  377. }).then(res => {
  378. that.dangerAreaData = res.data.map(item => {
  379. return {
  380. value: item.dangerAreaPid,
  381. text: item.dangerAreaName,
  382. }
  383. })
  384. }).catch(err => {
  385. console.log(err)
  386. })
  387. },
  388. // 分页触发
  389. pageChange(e) {
  390. this.pageCurrent = e.current;
  391. this.getPage()
  392. },
  393. onCheckPhotoClick(item) {
  394. let url = '/pages/yjxt/check/dangerareacheckdetail?id=' + item.id;;
  395. uni.navigateTo({
  396. url: url
  397. })
  398. },
  399. getPage(params = {}) {
  400. const current = this.pageCurrent;
  401. const size = this.pageSize;
  402. let postData = Object.assign(params, this.query);
  403. let that = this;
  404. http.request({
  405. url: '/galaxy-business/yj/check/page',
  406. method: 'GET',
  407. params: {
  408. current,
  409. size,
  410. },
  411. data: postData,
  412. }).then(res => {
  413. if (res.data.records != null) {
  414. that.list = res.data.records;
  415. }
  416. this.total = res.data.total;
  417. }).catch(err => {
  418. console.log(err)
  419. })
  420. },
  421. }
  422. }
  423. </script>
  424. <style lang="scss" scoped>
  425. </style>