index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <script setup>
  2. import {
  3. ref,
  4. getCurrentInstance
  5. } from "vue";
  6. import {
  7. onLoad,
  8. onPullDownRefresh,
  9. onReachBottom,
  10. onPageScroll
  11. } from "@dcloudio/uni-app";
  12. import {
  13. getJSDDlist,
  14. getHYFLlist,
  15. getJSXZlist,
  16. getXMLXlist,
  17. getProjectInfoList,
  18. getProjectGraphicList,
  19. } from "@/api/work/projectInfo.js";
  20. let searchInfo = ref({
  21. pageNo: 1,
  22. pageSize: 10,
  23. subName: null,
  24. propKind: null,
  25. indusKind: null,
  26. subjectId: null,
  27. kind: null,
  28. orderType: null,
  29. })
  30. let listTotal = ref(0);
  31. let projectList = ref([{}]);
  32. const reSearch = function() {
  33. searchInfo.value.pageNo = 1;
  34. projectList.value = [];
  35. listTotal.value = 0;
  36. moreListFlag = true;
  37. getList();
  38. };
  39. let loading = ref(false);
  40. let moreListFlag = true;
  41. const getList = function() {
  42. const params = Object.assign({}, searchInfo.value);
  43. if (params.propKind) params.propKind = jsxzFull.find(item => item.value === params.propKind).key;
  44. if (params.indusKind) params.indusKind = hyflFull.find(item => item.value === params.indusKind).key;
  45. if (params.subjectId) params.subjectId = jsddFull.find(item => item.value === params.subjectId).key;
  46. if (params.kind) params.kind = xmlxFull.find(item => item.value === params.kind).key;
  47. if (params.orderType) params.orderType = orderFull.find(item => item.value === params.orderType).key;
  48. if (searchInfo.value.pageNo == 1) {
  49. loading.value = true
  50. };
  51. getProjectGraphicList(params).then(res => {
  52. loading.value = false
  53. projectList.value = projectList.value.concat(res.data.list);
  54. listTotal.value = res.data.total;
  55. if (res.data.total == searchInfo.value.pageNo * searchInfo.value.pageSize - (10 - res.data.list
  56. .length)) moreListFlag = false;
  57. }).catch(() => {
  58. loading.value = false
  59. })
  60. }
  61. // 建设性质
  62. let jsxzFull = [];
  63. let jsxzColumns = ref([]);
  64. const getJSXZ = function() {
  65. getJSXZlist().then(res => {
  66. jsxzFull = res.data.list;
  67. jsxzColumns.value = [res.data.list.map(item => item.value)];
  68. })
  69. };
  70. let jsxzShow = ref(false);
  71. const jsxzShowChoose = function() {
  72. jsxzShow.value = true;
  73. }
  74. const jsxzClose = function(e) {
  75. if (e) searchInfo.value.propKind = e.value[0];
  76. jsxzShow.value = false;
  77. }
  78. // 行业分类
  79. let hyflFull = [];
  80. let hyflColumns = ref([]);
  81. const getHYFL = function() {
  82. getHYFLlist().then(res => {
  83. hyflFull = res.data.list;
  84. hyflColumns.value = [res.data.list.map(item => item.value)];
  85. })
  86. };
  87. let hyflShow = ref(false);
  88. const hyflShowChoose = function() {
  89. hyflShow.value = true;
  90. }
  91. const hyflClose = function(e) {
  92. if (e) searchInfo.value.indusKind = e.value[0];
  93. hyflShow.value = false;
  94. }
  95. // 建设地点
  96. let jsddFull = [];
  97. let jsddColumns = ref([]);
  98. const getJSDD = function() {
  99. getJSDDlist().then(res => {
  100. jsddFull = res.data.list;
  101. jsddColumns.value = [res.data.list.map(item => item.value)];
  102. })
  103. };
  104. let jsddShow = ref(false);
  105. const jsddShowChoose = function() {
  106. jsddShow.value = true;
  107. }
  108. const jsddClose = function(e) {
  109. if (e) searchInfo.value.subjectId = e.value[0];
  110. jsddShow.value = false;
  111. }
  112. // 项目类型
  113. let xmlxFull = [];
  114. let xmlxColumns = ref([]);
  115. const getXMLX = function() {
  116. getXMLXlist().then(res => {
  117. xmlxFull = res.data.list;
  118. xmlxColumns.value = [res.data.list.map(item => item.value)];
  119. })
  120. };
  121. let xmlxShow = ref(false);
  122. const xmlxShowChoose = function() {
  123. xmlxShow.value = true;
  124. }
  125. const xmlxClose = function(e) {
  126. if (e) searchInfo.value.kind = e.value[0];
  127. xmlxShow.value = false;
  128. }
  129. // 按金额排序
  130. let orderFull = [{
  131. key: null,
  132. value: "默认"
  133. }, {
  134. key: "asc",
  135. value: "升序"
  136. }, {
  137. key: "desc",
  138. value: "降序"
  139. }];
  140. let orderColumns = ref([
  141. ["默认", "升序", "降序"]
  142. ]);
  143. let orderShow = ref(false);
  144. const orderShowChoose = () => {
  145. orderShow.value = true;
  146. }
  147. const orderClose = function(e) {
  148. if (e) searchInfo.value.orderType = e.value[0];
  149. orderShow.value = false;
  150. }
  151. let modalshow = ref(false)
  152. const clickItem = id => {
  153. // modalshow.value = true
  154. uni.navigateTo({
  155. url: `/pages/projectImageAndVideo/index?subId=${id}`
  156. })
  157. }
  158. // 折叠/展开
  159. const changeFoldItem = (status, id) => {
  160. let item = projectList.value.find(item => item.id === id);
  161. item.unfold = status;
  162. }
  163. onLoad(() => {
  164. getJSXZ(); //获取建设性质
  165. getHYFL(); //获取行业分类
  166. getJSDD(); //获取建设地点
  167. getXMLX(); //获取项目类型
  168. reSearch();
  169. })
  170. let scrollTop = ref(0);
  171. onPageScroll((e) => {
  172. scrollTop.value = e.scrollTop
  173. })
  174. onPullDownRefresh(() => {
  175. try {
  176. reSearch();
  177. } finally {
  178. uni.stopPullDownRefresh()
  179. }
  180. })
  181. onReachBottom(() => {
  182. if (!moreListFlag) {
  183. return uni.showToast({
  184. title: "已经到底了。",
  185. icon: "none",
  186. duration: 2000
  187. })
  188. }
  189. searchInfo.value.pageNo++;
  190. getList();
  191. })
  192. </script>
  193. <template>
  194. <view class="container">
  195. <page-title>项目形象进度</page-title>
  196. <view class="cards-list">
  197. <view class="card only-card">
  198. <!-- 项目名称 -->
  199. <view class="card-item first-card-item">
  200. <view class="card-item-name">项目名称</view>
  201. <input v-model="searchInfo.subName" class="card-item-input" placeholder="请填写项目名称"
  202. placeholder-style="color: #D8D8D8" maxlength="20" />
  203. </view>
  204. <!-- 建设性质 -->
  205. <view class="card-item" @click="jsxzShowChoose()">
  206. <view class="card-item-name">建设性质</view>
  207. <view class="card-item-description">
  208. <view v-if="searchInfo.propKind">{{searchInfo.propKind}}</view>
  209. <view v-else class="remind-text">请选择性质</view>
  210. <u-icon name="arrow-right" color="#343437" size="16" customStyle="margin-left:10rpx"></u-icon>
  211. </view>
  212. </view>
  213. <!-- 行业分类 -->
  214. <view class="card-item" @click="hyflShowChoose()">
  215. <view class="card-item-name">行业分类</view>
  216. <view class="card-item-description">
  217. <view v-if="searchInfo.indusKind">{{searchInfo.indusKind}}</view>
  218. <view v-else class="remind-text">请选择分类</view>
  219. <u-icon name="arrow-right" color="#343437" size="16" customStyle="margin-left:10rpx"></u-icon>
  220. </view>
  221. </view>
  222. <!-- 建设地点 -->
  223. <view class="card-item" @click="jsddShowChoose()">
  224. <view class="card-item-name">建设地点</view>
  225. <view class="card-item-description">
  226. <view v-if="searchInfo.subjectId">{{searchInfo.subjectId}}</view>
  227. <view v-else class="remind-text">请选择地点</view>
  228. <u-icon name="arrow-right" color="#343437" size="16" customStyle="margin-left:10rpx"></u-icon>
  229. </view>
  230. </view>
  231. <!-- 项目类型 -->
  232. <view class="card-item" @click="xmlxShowChoose()">
  233. <view class="card-item-name">项目类型</view>
  234. <view class="card-item-description">
  235. <view v-if="searchInfo.kind">{{searchInfo.kind}}</view>
  236. <view v-else class="remind-text">请选择类型</view>
  237. <u-icon name="arrow-right" color="#343437" size="16" customStyle="margin-left:10rpx"></u-icon>
  238. </view>
  239. </view>
  240. <!-- 按金额排序 -->
  241. <view class="card-item" @click="orderShowChoose()">
  242. <view class="card-item-name">按金额排序</view>
  243. <view class="card-item-description">
  244. <view v-if="searchInfo.orderType">{{searchInfo.orderType}}</view>
  245. <view v-else class="remind-text">请选择排序</view>
  246. <u-icon name="arrow-right" color="#343437" size="16" customStyle="margin-left:10rpx"></u-icon>
  247. </view>
  248. </view>
  249. </view>
  250. <view class="search-btn" @click="reSearch()">确定</view>
  251. <view v-for="(item,index) in projectList" :key="index">
  252. <!-- 未折叠卡片 -->
  253. <view class="card card-padding" v-if="item.unfold">
  254. <!-- 项目名称 -->
  255. <view class="card-item">
  256. <view class="card-item-name">项目名称</view>
  257. <view class="card-item-content">{{item.subName ?? "--"}}</view>
  258. </view>
  259. <!-- 总投资(万元) -->
  260. <view class="card-item">
  261. <view class="card-item-name">总投资(万元)</view>
  262. <view class="card-item-content">{{item.amtTotal ?? "--"}}</view>
  263. </view>
  264. <!-- 年度计划投资-申报单位(万元) -->
  265. <view class="card-item">
  266. <view class="card-item-name">年度计划投资-申报单位(万元)</view>
  267. <view class="card-item-content">{{item.yearAmt ?? "--"}}</view>
  268. </view>
  269. <!-- 已完成投资(万元)-->
  270. <view class="card-item">
  271. <view class="card-item-name">已完成投资(万元)</view>
  272. <view class="card-item-content">{{item.yearAmtSj ?? "--"}}</view>
  273. </view>
  274. <!-- 当前状态 -->
  275. <view class="card-item">
  276. <view class="card-item-name">当前状态</view>
  277. <view class="card-item-content">{{item.status ?? "--"}}</view>
  278. </view>
  279. <!-- 形象进度展示 -->
  280. <view class="card-item" @click="clickItem(item.id)">
  281. <view class="card-btn fat-btn">形象进度展示</view>
  282. </view>
  283. <!-- 编号 -->
  284. <view class="card-fold-option"
  285. :class="item.status_fgw === '2' ? 'card-fold-red' :item.status_fgw === '1' ?'card-fold-yellow':''">
  286. <view class="card-fold-count">{{index + 1}} / {{listTotal}}</view>
  287. <view class="card-fold-center" @click.stop="changeFoldItem(false,item.id)">
  288. <view class="card-fold-btn card-unfold-btn"></view>
  289. </view>
  290. <view class="card-fold-chaos"></view>
  291. </view>
  292. </view>
  293. <!-- 折叠卡片 -->
  294. <view class="card-fold" v-else>
  295. {{item.subName ?? "--"}}
  296. <view class="card-fold-option"
  297. :class="item.status_fgw === '2' ? 'card-fold-red' :item.status_fgw === '1' ?'card-fold-yellow':''">
  298. <view class="card-fold-count">{{index + 1}} / {{listTotal}}</view>
  299. <view class="card-fold-center" @click.stop="changeFoldItem(true, item.id)">
  300. <view class="card-fold-btn"></view>
  301. </view>
  302. <view class="card-fold-chaos"></view>
  303. </view>
  304. </view>
  305. </view>
  306. <empty-show v-if="projectList.length===0"></empty-show>
  307. </view>
  308. <!-- 建设性质 -->
  309. <u-picker :show="jsxzShow" :columns="jsxzColumns" @confirm="jsxzClose" @cancel="jsxzClose" @close="jsxzClose"
  310. closeOnClickOverlay></u-picker>
  311. <!-- 行业分类 -->
  312. <u-picker :show="hyflShow" :columns="hyflColumns" @confirm="hyflClose" @cancel="hyflClose" @close="hyflClose"
  313. closeOnClickOverlay></u-picker>
  314. <!-- 建设地点 -->
  315. <u-picker :show="jsddShow" :columns="jsddColumns" @confirm="jsddClose" @cancel="jsddClose" @close="jsddClose"
  316. closeOnClickOverlay></u-picker>
  317. <!-- 项目类型 -->
  318. <u-picker :show="xmlxShow" :columns="xmlxColumns" @confirm="xmlxClose" @cancel="xmlxClose" @close="xmlxClose"
  319. closeOnClickOverlay></u-picker>
  320. <!-- 金额排序 -->
  321. <u-picker :show="orderShow" :columns="orderColumns" @confirm="orderClose" @cancel="orderClose" @close="orderClose"
  322. closeOnClickOverlay></u-picker>
  323. <u-modal :show="modalshow" title="提示" confirmText='退出' content='智慧工地在线正在建设中,请耐心等待!'
  324. @confirm='modalshow = false'></u-modal>
  325. <u-toast ref="uToastRef"></u-toast>
  326. <u-loading-page :loading="loading"></u-loading-page>
  327. </view>
  328. </template>
  329. <style lang="scss" scoped>
  330. .search-btn {
  331. width: 98%;
  332. height: 84rpx;
  333. margin: 40rpx auto 56rpx;
  334. line-height: 84rpx;
  335. text-align: center;
  336. color: #FFFFFF;
  337. font-size: 36rpx;
  338. background: #1763E7;
  339. border-radius: 16rpx;
  340. }
  341. .card {
  342. padding: 40rpx;
  343. overflow: hidden;
  344. .card-value {
  345. position: absolute;
  346. top: 0;
  347. left: 0;
  348. width: 255rpx;
  349. height: 68rpx;
  350. padding-left: 40rpx;
  351. line-height: 68rpx;
  352. color: #1869F6;
  353. font-size: 32rpx;
  354. background: linear-gradient(90deg, #B2CEFF 0%, rgba(219, 232, 255, 0) 100%);
  355. }
  356. .card-online {
  357. position: absolute;
  358. bottom: 0;
  359. right: 0;
  360. width: 422rpx;
  361. height: 68rpx;
  362. padding-right: 40rpx;
  363. text-align: right;
  364. line-height: 68rpx;
  365. color: #00737B;
  366. font-size: 32rpx;
  367. background: linear-gradient(270deg, #96F8FF 0%, rgba(219, 232, 255, 0) 100%);
  368. }
  369. .last-card-item {
  370. margin-bottom: 40rpx
  371. }
  372. }
  373. .card-fold {
  374. position: relative;
  375. width: 100%;
  376. min-height: 152rpx;
  377. margin-bottom: 20rpx;
  378. padding: 24rpx 30rpx 52rpx;
  379. box-sizing: border-box;
  380. background: #FFFFFF;
  381. border-radius: 40rpx;
  382. overflow: hidden;
  383. }
  384. .card-fold-option {
  385. position: absolute;
  386. display: flex;
  387. justify-content: space-between;
  388. align-items: center;
  389. left: 0;
  390. bottom: 0;
  391. width: 100%;
  392. height: 38rpx;
  393. padding: 0 40rpx;
  394. box-sizing: border-box;
  395. background: linear-gradient(270deg, #CADDFF 4%, rgba(219, 232, 255, 0) 100%);
  396. z-index: 999;
  397. .card-fold-count {
  398. flex: 1;
  399. font-size: 28rpx;
  400. color: #1869F6;
  401. }
  402. .card-fold-center {
  403. flex: 1;
  404. .card-fold-btn {
  405. width: 32rpx;
  406. height: 20rpx;
  407. margin: 0 auto;
  408. background-image: url("@/static/icon-fold.png");
  409. background-size: 100% 100%;
  410. }
  411. .card-unfold-btn {
  412. transform: rotate(180deg);
  413. }
  414. }
  415. .card-fold-chaos {
  416. flex: 1;
  417. }
  418. }
  419. .card-fold-red {
  420. background: linear-gradient(270deg, #FF8080 0%, rgba(219, 232, 255, 0) 100%);
  421. .card-fold-count {
  422. color: #FF0000;
  423. }
  424. .card-fold-center {
  425. .card-fold-btn {
  426. background-image: url("@/static/icon-fold-red.png");
  427. }
  428. }
  429. }
  430. .card-fold-yellow {
  431. background: linear-gradient(270deg, #FFAA00 4%, rgba(219, 232, 255, 0) 100%);
  432. .card-fold-count {
  433. color: #E19703;
  434. }
  435. .card-fold-center {
  436. .card-fold-btn {
  437. background-image: url("@/static/icon-fold-yellow.png");
  438. }
  439. }
  440. }
  441. .card-padding {
  442. padding: 16rpx 40rpx 60rpx;
  443. overflow: hidden;
  444. }
  445. </style>