dangerareachecklist.vue 12 KB

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