移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

550 lines
18 KiB

  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header_main">
  4. 产业信息管理
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. <div class="add_btn" @click="goAdd"></div>
  7. </div>
  8. <div class="search_info">
  9. <div class="search_block">
  10. <van-search class="search_block searchHeight" v-model="queryParams.industryName" @input="getSearchList" :placeholder="searchPlaceholder" />
  11. <van-icon name="filter-o" color="#1989fa" class="filter-icon" @click="openIndustryRights" />
  12. </div>
  13. <div class="total">共{{listLength}}个产业</div>
  14. </div>
  15. <div class="list_main">
  16. <van-list
  17. v-model="loading"
  18. :finished="finished"
  19. finished-text="没有更多了"
  20. @load="getList"
  21. >
  22. <!--1-->
  23. <van-swipe-cell right-width="200" class="item" v-for="(item,index) in applicationList" :key="index">
  24. <div class="item_box" @click="$router.push({name:'sunVillageInfoListIndustryDetail',query:{id:item.id}})">
  25. <div class="head_block">
  26. <i class="icon"></i>
  27. <div class="title">{{item.industryName}}</div>
  28. <div class="describe">{{item.industryRights}}</div>
  29. </div>
  30. <div class="order_block">
  31. <div class="order">{{item.industryCode}}</div>
  32. <div class="describe">{{item.industryType}}</div>
  33. </div>
  34. </div>
  35. <template #right>
  36. <div @click="handleDelete(item,index)" style="background-color: #ee0a24;height: 100%">删除</div>
  37. <router-link :to="{name:'sunVillageInfoListIndustryEdit',query:{id:item.id}}" style="background-color: #07c160">修改</router-link>
  38. <div @click="openLoader(item.id,0)" style="background-color: rgb(98,173,102,0.2);color: #62AD66;">附件</div>
  39. <div @click="openMap(item.id, item.theGeom,index)" style="background-color: #62AD66;color: #ffffff;">地图</div>
  40. </template>
  41. </van-swipe-cell>
  42. </van-list>
  43. </div>
  44. <!-- <div class="bottom_tips">-->
  45. <!-- <span class="xs">已经到底啦</span>-->
  46. <!-- </div>-->
  47. <van-popup v-model="showMap" lock-scroll position="top" :style="{ height: '80%' }" >
  48. <div style="padding: 0;text-align: center">
  49. <MapGisLine ref="clickLoading" :message="theGeom" v-on:formSubmit="MapTag" :resourceId="resourceId" :resourceList="resourceList"></MapGisLine>
  50. <!-- <div>地图信息:绿色地块表示该地块,蓝色表示本账套已标记的其他地块</div>-->
  51. <div style="margin-top: 1.5vh">
  52. <van-button type="info" size="small" @click="saveGeom">保存</van-button>
  53. <van-button type="danger" size="small" @click="clearLayer">清除图层</van-button>
  54. <van-button plain type="info" size="small" @click="showMap = false">取消</van-button>
  55. </div>
  56. </div>
  57. </van-popup>
  58. <van-popup v-model="show" lock-scroll closeable position="top" :style="{ height: '30%' }" >
  59. <div style="padding: 0 13% 0 5%;">
  60. <van-divider>附件</van-divider>
  61. <van-uploader v-model="fileList" :after-read="afterRead" @delete="deleteFile1" multiple />
  62. </div>
  63. </van-popup>
  64. <van-popup v-model="typeVisible" lock-scroll closeable position="top" >
  65. <div style="padding: 0.2rem 0.3rem 0.3rem;">
  66. <van-cell-group>
  67. <van-cell>
  68. <div style="text-align: center; font-size: 18px;">筛选</div>
  69. </van-cell>
  70. <van-cell>
  71. <van-checkbox v-model="queryParams.params.noMap" :border="false">未上图</van-checkbox>
  72. </van-cell>
  73. <van-cell>
  74. <van-checkbox v-model="queryParams.params.noAttachment" :border="false">无附件</van-checkbox>
  75. </van-cell>
  76. <field-select
  77. v-model="queryParams.industryRights"
  78. label="产业权属"
  79. value-key="dictLabel"
  80. data-key="dictValue"
  81. placeholder="选择产业权属"
  82. :columns="industryRightsOptions"
  83. :clearable="true"
  84. />
  85. </van-cell-group>
  86. <div style="padding: 0.2rem 0.5rem 0;">
  87. <van-button round type="primary" block @click="refresh">搜索</van-button>
  88. </div>
  89. </div>
  90. </van-popup>
  91. </div>
  92. </template>
  93. <script>
  94. import {
  95. commonAttach,
  96. attachmentList,
  97. systemAttachment,
  98. } from "@/api/sunVillage_info/three";
  99. import { listIndustry, statisticIndustry, getIndustry, delIndustry, addIndustry, updateIndustry, exportIndustry,clearTheGeom } from "@/api/sunVillage_info/industry";
  100. import request from '@/utils/request'
  101. import MapGisLine from "@/components/Map/MapGisLine";
  102. import Selector from "@/components/common/Selector.vue";
  103. import FieldSelect from "@/components/form/FieldSelect.vue";
  104. export default {
  105. name: "certificateList",
  106. components: {FieldSelect, Selector, MapGisLine,},
  107. data() {
  108. return {
  109. theGeom:'',
  110. applicationList:[],
  111. applicationListSecond:[],
  112. assetStatusOptions:[],
  113. auditStatus:[],
  114. loading: false,
  115. finished: false,
  116. show: false,
  117. showMap: false,
  118. fileList:[],
  119. listLength:'0',
  120. searchInput:'',
  121. queryParams:{
  122. pageNum:1,
  123. pageSize:10,
  124. orderByColumn:'createTime',
  125. isAsc:'desc',
  126. translate_dict:1,
  127. industryName:'',
  128. industryRights: null,
  129. params: {
  130. noMap: false,
  131. noAttachment: false,
  132. },
  133. },
  134. uploadFiles1:[],
  135. projectId:'',
  136. projectIndex:'',
  137. showBtn:true,
  138. listMap: 0,
  139. resourceId: null, // 资产ID,记录当前资产的ID
  140. resourceList: [], // 资产列表,存储本账套下所有的资产信息
  141. typeVisible: false,
  142. industryRightsOptions: [],
  143. };
  144. },
  145. created() {
  146. this.houseGetDicts("industry_rights_type").then((response) => {
  147. this.industryRightsOptions = response.data;
  148. });
  149. },
  150. methods: {
  151. saveGeom(){
  152. var that = this;
  153. updateIndustry({id: this.resourceId, theGeom: this.theGeom}).then((response) => {
  154. if (response.code == 200){
  155. this.$notify({ type: 'success', message: '修改成功' });
  156. setTimeout(function(){
  157. that.showMap = false;
  158. getIndustry(that.resourceId).then(response => {
  159. that.applicationList[that.listMap].theGeom = response.data.theGeom;
  160. });
  161. },500)
  162. }
  163. });
  164. },
  165. clearLayer() {
  166. this.$dialog.confirm({
  167. message: '是否清除图层?',
  168. }).then(() => {
  169. // on confirm
  170. clearTheGeom(this.resourceId).then(res => {
  171. if (res.code === 200) {
  172. this.$notify({ type: 'success', message: '清除成功' });
  173. this.showMap = false;
  174. this.applicationList[this.listMap].theGeom = null;
  175. }
  176. });
  177. }).catch(() => {
  178. // on cancel
  179. });
  180. },
  181. openMap(id, theGeom,index){
  182. listIndustry().then(response => {
  183. this.showMap = true;
  184. this.resourceId = id;
  185. this.theGeom = theGeom;
  186. this.listMap = index;
  187. this.resourceList = response.rows;
  188. this.mapClickLoading();
  189. });
  190. },
  191. //每个查看修改,新增 方法下引用下面方法
  192. mapClickLoading(){
  193. setTimeout(() => {
  194. this.$refs.clickLoading.drawingPaceCountryLine();
  195. }, 1000);
  196. },
  197. /** 查找地图中定位点 */
  198. MapTag: function (data) {
  199. // this.applicationList[this.listMap].theGeom = data;
  200. this.theGeom = data;
  201. },
  202. guidProduct(){
  203. return 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
  204. var r = Math.random() * 16 | 0,
  205. v = c == 'x' ? r : (r & 0x3 | 0x8);
  206. return v.toString(16);
  207. });
  208. },
  209. getList(){
  210. this.loading = true;
  211. listIndustry(this.queryParams).then(response => {
  212. this.listLength = response.total;
  213. response.rows.forEach(item => {
  214. this.applicationList.push(item);
  215. });
  216. if(this.applicationList.length >= response.total){
  217. this.finished = true;
  218. return;
  219. }else{
  220. this.loading = false;
  221. this.queryParams.pageNum += 1 ;
  222. }
  223. });
  224. },
  225. afterRead(file) {
  226. // 此时可以自行将文件上传至服务器
  227. console.log(file)
  228. this.uploadFiles1.push(file.file);
  229. let params1 = new FormData();
  230. params1.append("tableId", this.projectId);
  231. params1.append("tableName", "t_asset_industry");
  232. params1.append("bizPath", "asset");
  233. params1.append("fileType", this.projectIndex);
  234. params1.append("file", file.file);
  235. commonAttach(params1).then((r1) => {
  236. this.$notify({ type: 'success', message: '上传成功' });
  237. })
  238. },
  239. openLoader(id,index){
  240. this.show = true;
  241. this.projectId = id;
  242. this.projectIndex = index;
  243. this.fileList = [];
  244. let oData1= {
  245. tableId: id,
  246. tableName: "t_asset_industry",
  247. bizPath: "asset",
  248. fileType: '',
  249. }
  250. attachmentList(oData1).then(res => {
  251. res.rows.map(r => {
  252. let baseUrl = location.protocol+"//"+location.host+request.defaults.baseURL
  253. this.fileList.push({"url":baseUrl + r.fileUrl,"file":new File([],r.fileName,{}),"id":r.id})
  254. })
  255. })
  256. },
  257. /** 删除按钮操作 */
  258. handleDelete(row,index) {
  259. const ids = row.id || this.ids;
  260. this.$dialog.alert(
  261. {
  262. message:'是否确认删除资产?',
  263. title:"警告",
  264. showCancelButton:true,
  265. confirmButtonText: "确定",
  266. cancelButtonText: "取消",
  267. }
  268. )
  269. .then(function () {
  270. return delIndustry(ids);
  271. })
  272. .then(() => {
  273. this.applicationList.splice(index, 1);
  274. this.$notify({ type: 'success', message: '删除成功' });
  275. });
  276. },
  277. getSearchList(){
  278. this.queryParams.pageNum = 1;
  279. this.finished = false;
  280. this.applicationList = [];
  281. this.getList();
  282. },
  283. deleteFile1(file){
  284. console.log(file)
  285. systemAttachment(file.id).then(res => {
  286. this.$notify({ type: 'success', message: '删除成功' });
  287. })
  288. },
  289. goAdd(){
  290. this.$router.push('/sunVillage_info/industryAdd')
  291. },
  292. openIndustryRights() {
  293. this.typeVisible = true;
  294. },
  295. refresh() {
  296. this.typeVisible = false;
  297. this.queryParams.pageNum = 1;
  298. this.listLength = 0;
  299. this.applicationList = [];
  300. this.finished = false;
  301. this.getList();
  302. },
  303. },
  304. computed: {
  305. searchPlaceholder() {
  306. let typeName = this.industryRightsOptions.find((x) => x.dictValue == this.queryParams.industryRights);
  307. return '搜索' + (typeName ? typeName.dictLabel : '');
  308. },
  309. }
  310. }
  311. </script>
  312. <style scoped lang="scss">
  313. /deep/ .van-search__content{
  314. background-color: transparent;
  315. }
  316. .home_wrapper{
  317. background: #e9e9e9;
  318. min-height: 100vh;
  319. width: 100vw;
  320. .header_main {
  321. height: 116px;
  322. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  323. background-size: 100% 100%;
  324. position: fixed;
  325. top: 0;
  326. left: 0;
  327. width: 100%;
  328. font-size: 36px;
  329. line-height: 116px;
  330. text-align: center;
  331. color: #fff;
  332. position: relative;
  333. .return_btn {
  334. width: 24px;
  335. height: 43.2px;
  336. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  337. background-size: 20px 36px;
  338. position: absolute;
  339. left: 38px;
  340. top: 36px;
  341. }
  342. .add_btn {
  343. width: 56.4px;
  344. height: 40.8px;
  345. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  346. background-size: 47px 34px;
  347. position: absolute;
  348. right: 38px;
  349. top: 36px;
  350. }
  351. }
  352. .search_info{
  353. padding:20px 23px;
  354. display: flex;
  355. .search_block{
  356. width: 535px;
  357. border-radius: 59px;
  358. background: #fff;
  359. display: flex;
  360. border:2px solid #3494ff;
  361. padding-right: 20px;
  362. align-items: center;
  363. &.searchHeight{
  364. border: none;
  365. height: 57px;
  366. padding-left: 0;
  367. }
  368. .icon{
  369. width: 30px;
  370. height: 30px;
  371. background: url('../../assets/images/sunVillage_info/fixedAssets_icon_1.png') no-repeat;
  372. background-size: 100% 100%;
  373. display: block;
  374. margin:0 8px 0 26px;
  375. }
  376. .filter-icon {
  377. font-weight: bold;
  378. font-size: .4rem;
  379. width: .6rem;
  380. text-align: center;
  381. }
  382. .ipt{
  383. flex: 1;
  384. font-size: 26px;
  385. background: none;
  386. border:0 none;
  387. line-height: 59px;
  388. }
  389. }
  390. .total{
  391. flex: 1;
  392. display: flex;
  393. align-items: center;
  394. justify-content: center;
  395. font-size: 26px;
  396. color: #858585;
  397. }
  398. }
  399. .list_main{
  400. padding:0 22px;
  401. .item{
  402. /*height: 198px;*/
  403. border-radius: 30px;
  404. background: #fff;
  405. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  406. margin-bottom: 20px;
  407. .item_box{
  408. padding:25px 32px;
  409. }
  410. .head_block{
  411. height: 56px;
  412. display: flex;
  413. align-items: center;
  414. width: 100%;
  415. .icon{
  416. width: 34px;
  417. height: 30px;
  418. background: url('../../assets/images/sunVillage_info/fixedAssets_icon_2.png') no-repeat;
  419. background-size: 100% 100%;
  420. display: block;
  421. margin-right: 12px;
  422. }
  423. .title{
  424. flex:1;
  425. font-size: 32px;
  426. color: #252525;
  427. overflow: hidden;
  428. text-overflow: ellipsis;
  429. white-space: nowrap;
  430. padding-right: 20px;
  431. }
  432. .describe{
  433. height: 34px;
  434. padding: 0 15px;
  435. font-size: 24px;
  436. color: #3494ff;
  437. background: #e6f2ff;
  438. border-radius: 8px;
  439. }
  440. }
  441. .order_block{
  442. height: 50px;
  443. display: flex;
  444. align-items: center;
  445. width: 100%;
  446. .order{
  447. flex: 1;
  448. font-size: 26px;
  449. color: #252525;
  450. }
  451. .describe{
  452. font-size: 26px;
  453. color: #3494ff;
  454. }
  455. }
  456. .function_block{
  457. height: 46px;
  458. display: flex;
  459. align-items: center;
  460. .time{
  461. display: flex;
  462. flex: 1;
  463. align-items: center;
  464. font-size: 24px;
  465. color: #858585;
  466. .icon{
  467. width: 25px;
  468. height: 25px;
  469. background: url('../../assets/images/sunVillage_info/fixedAssets_icon_3.png') no-repeat;
  470. background-size: 100% 100%;
  471. display: block;
  472. margin-right: 8px;
  473. }
  474. }
  475. .state{
  476. /*flex: 1;*/
  477. display: flex;
  478. justify-content: center;
  479. align-items: center;
  480. &.sell{
  481. color: #f69600;
  482. }
  483. &.scrap{
  484. color: #858585;
  485. }
  486. &.normal{
  487. color: #68c000;
  488. }
  489. }
  490. .value{
  491. flex:1;
  492. display: flex;
  493. align-items: center;
  494. justify-content:flex-end;
  495. font-size: 24px;
  496. color: #858585;
  497. .amount{
  498. color: #eb1616;
  499. }
  500. }
  501. }
  502. }
  503. }
  504. .bottom_tips{
  505. font-size: 24px;
  506. color: #a7a6a6;
  507. text-align: center;
  508. margin-top: 32px;
  509. background: url('../../assets/images/sunVillage_info/list_icon_8.png') center center no-repeat;
  510. background-size: 260px 2px;
  511. .xs{
  512. padding:0 8px;
  513. background: #e9e9e9;
  514. }
  515. }
  516. /deep/ .van-swipe-cell__right{
  517. display: flex;
  518. align-items: center;
  519. width: 200PX;
  520. margin-left: 5PX;
  521. a,div{
  522. margin: 0;
  523. display: flex;
  524. align-items: center;
  525. justify-content: center;
  526. color: #ffffff;
  527. font-size: 14PX;
  528. height: 100%;
  529. flex: 1;
  530. }
  531. }
  532. }
  533. </style>