移动端
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.
 
 

489 line
14 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" v-show="showBtn"></div>
  7. </div>
  8. <div class="record_main">
  9. <div class="record_det">
  10. <div class="year_l" @click="tabShow"><i :class="{'icon':true , 'zk':!showTab , 'ss':showTab } "></i>{{year == '' ? '全部': year}}<span class="unit">{{year == '' ? '': '年'}}</span>{{month}}<span class="unit">{{month == '' ? '': '月'}}</span></div>
  11. <div class="total_r">共{{listLength}}条公告</div>
  12. </div>
  13. <div class="date_box" v-if="showTab">
  14. <div class="record_list">
  15. <div :class="{'flex_block':true , 'current':year == ''}" @click="tabClick('')">全部</div>
  16. <div v-for="(item,index) in yearList" :key="index" :class="{'flex_block':true , 'current':year == item}" @click="tabClick(item)">{{item}}</div>
  17. </div>
  18. <div class="record_list month_list">
  19. <div v-for="(item,index) in 12" :key="index" :class="{'flex_block':true , 'current':month == item}" @click="tabClickMonth(item)">
  20. {{item}}</div>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="list_main">
  25. <van-list
  26. v-model="loading"
  27. :finished="finished"
  28. finished-text="没有更多了"
  29. @load="getList"
  30. >
  31. <!----1-->
  32. <div class="item" v-for="(item,index) in applicationList" :key="index">
  33. <div class="info" @click="goDetail(item.id)">
  34. <div class="title">
  35. <i class="icon_box"></i>
  36. <p class="news_title">{{item.workerName}}</p>
  37. <!-- <p class="tips_mark" v-if="index==0">新</p>-->
  38. <div class="money">¥{{item.totalMoney}}</div>
  39. </div>
  40. <div class="time">
  41. <div class="icon_time"></div>{{item.jobTime}}
  42. </div>
  43. </div>
  44. <div class="operation">
  45. <!-- delete 删除 edit编辑 view查看 -->
  46. <div class="opera_btn edit" @click="goEdit(item.id)" v-show="showBtn">
  47. <i class="icon "></i>
  48. </div>
  49. <div class="opera_btn delete" @click="goRemove(item.id)" v-show="showBtn">
  50. <i class="icon"></i>
  51. </div>
  52. <!-- <div class="opera_btn list" @click="goRanking(item.id,item.openNy)" v-show="!showBtn">-->
  53. <!-- <i class="icon "></i>-->
  54. <!-- </div>-->
  55. <!-- <div class="opera_btn view" @click="goDetail(item.id)" v-show="!showBtn">-->
  56. <!-- <i class="icon "></i>-->
  57. <!-- </div>-->
  58. </div>
  59. </div>
  60. </van-list>
  61. </div>
  62. <!-- <div class="bottom_tips">-->
  63. <!-- <span class="xs">已经到底啦</span>-->
  64. <!-- </div>-->
  65. </div>
  66. </template>
  67. <script>
  68. import { listOddjob , delOddjob } from "@/api/sunVillage_info/fixedAssets";
  69. import Cookies from "js-cookie";
  70. import request from '@/utils/request'
  71. export default {
  72. name: "certificateList",
  73. data() {
  74. return {
  75. applicationList:[],
  76. applicationListSecond:[],
  77. assetStatusOptions:[],
  78. auditStatus:[],
  79. loading: false,
  80. finished: false,
  81. show: false,
  82. showTab: false,
  83. fileList:[],
  84. listLength:'0',
  85. searchInput:'',
  86. queryParams:{
  87. pageNum:1,
  88. pageSize:10,
  89. orderByColumn:'jobTime',
  90. isAsc:'desc',
  91. yearMonth:'',
  92. },
  93. uploadFiles1:[],
  94. projectId:'',
  95. projectIndex:'',
  96. showBtn:true,
  97. year:'',
  98. month:'',
  99. nowYear:new Date().getFullYear(),
  100. yearList:[]
  101. };
  102. },
  103. created() {
  104. this.queryParams.bookId = Cookies.get('bookId');
  105. this.queryParams.deptId = Cookies.get('deptId');
  106. if (this.$route.query.type == 'code'){
  107. this.showBtn = false;
  108. }
  109. for (let i = 0 ; i < 5 ; i++){
  110. this.yearList.push(this.nowYear-i);
  111. }
  112. },
  113. methods: {
  114. getList(){
  115. console.log(this.finished)
  116. var _this = this;
  117. listOddjob(_this.queryParams).then(response => {
  118. _this.listLength = response.total;
  119. response.rows.map(res=>{
  120. _this.applicationList.push(res);
  121. })
  122. console.log(_this.applicationList.length)
  123. if(_this.applicationList.length >= response.total){
  124. _this.finished = true;
  125. return;
  126. }else{
  127. _this.loading = false;
  128. _this.queryParams.pageNum += 1 ;
  129. }
  130. });
  131. },
  132. tabClick(year){
  133. this.year = year ;
  134. if (year == ''){
  135. this.queryParams.yearMonth = ''
  136. this.month = ''
  137. }else{
  138. this.queryParams.yearMonth = year + '- 01'
  139. this.month = '1'
  140. }
  141. this.finished = false;
  142. this.queryParams.pageNum = 1;
  143. this.applicationList = [];
  144. this.getList();
  145. },
  146. tabClickMonth(month){
  147. this.month = month ;
  148. if (month < 10){
  149. this.queryParams.yearMonth = this.year + '-0' + month
  150. }else{
  151. this.queryParams.yearMonth = this.year + '-' + month
  152. }
  153. this.finished = false;
  154. this.queryParams.pageNum = 1;
  155. this.applicationList = [];
  156. this.getList();
  157. },
  158. tabShow(){
  159. this.showTab = !this.showTab;
  160. },
  161. /** 删除按钮操作 */
  162. handleDelete(row,index) {
  163. let assetStatus = row.assetStatus ? row.assetStatus : data[0].assetStatus;
  164. if (assetStatus === '2' || assetStatus === '3') {
  165. this.$notify({
  166. message: "不允许删除已出售或已报废的资产",
  167. type: "warning",
  168. });
  169. return;
  170. }
  171. let useType = row.useType;
  172. if(useType == 3) {
  173. this.$notify({
  174. message: "出租或出借的资产不允许删除",
  175. type: "warning",
  176. });
  177. return ;
  178. }
  179. const ids = row.id || this.ids;
  180. this.$dialog.alert(
  181. {
  182. message:'是否确认删除固定资产?',
  183. title:"警告",
  184. confirmButtonText: "确定",
  185. cancelButtonText: "取消",
  186. }
  187. )
  188. .then(function () {
  189. return delPermanent(ids);
  190. })
  191. .then(() => {
  192. this.applicationList.splice(index, 1);
  193. this.$notify({ type: 'success', message: '删除成功' });
  194. });
  195. },
  196. goAdd(){
  197. this.$router.push('/sunVillage_info/list_register_add')
  198. },
  199. goDetail(id){
  200. this.$router.push({path:'/sunVillage_info/list_register_detail',query: {id:id}})
  201. },
  202. goEdit(id){
  203. this.$router.push({path:'/sunVillage_info/list_register_edit',query: {id:id}})
  204. },
  205. goRanking(id,time){
  206. this.$router.push({path:'/sunVillage_info/list_tourists_ranking',query: {id:id,time:time}})
  207. },
  208. goRemove(id){
  209. this.$dialog.alert({
  210. title: '提示',
  211. message: '确认删除?',
  212. showCancelButton:true,
  213. })
  214. .then(() => {
  215. delOddjob(id).then(response => {
  216. this.$notify({ type: 'success', message: '删除成功' });
  217. this.getList()
  218. });
  219. })
  220. .catch(() => {
  221. // on cancel
  222. });
  223. }
  224. },
  225. }
  226. </script>
  227. <style scoped lang="scss">
  228. .date_box{
  229. background: url('../../assets/images/sunVillage_info/date_bg.png') no-repeat;
  230. background-size: 100% 100%;
  231. height: 90PX;
  232. padding: 0 15PX;
  233. margin-top: 15PX;
  234. .record_list{
  235. height: 45PX;
  236. align-items: center;
  237. }
  238. .month_list{
  239. border-top: 2PX dashed #e2e2e2;
  240. }
  241. }
  242. .home_wrapper{
  243. background: #e9e9e9;
  244. min-height: 100vh;
  245. width: 100vw;
  246. .header_main{
  247. height: 116px;
  248. background: url('../../assets/images/sunVillage_info/list_head.png') no-repeat;
  249. background-size: 100% 100%;
  250. position: fixed;
  251. top: 0;
  252. left: 0;
  253. width: 100%;
  254. font-size: 36px;
  255. line-height: 116px;
  256. text-align: center;
  257. color: #fff;
  258. position: relative;
  259. .return_btn{
  260. width: 24px;
  261. height: 43.2px;
  262. background: url('../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  263. background-size: 20px 36px;
  264. position: absolute;
  265. left: 38px;
  266. top: 36px;
  267. }
  268. .add_btn{
  269. width: 56.4px;
  270. height: 40.8px;
  271. background: url('../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  272. background-size: 47px 34px;
  273. position: absolute;
  274. right: 38px;
  275. top: 36px;
  276. }
  277. }
  278. .record_main{
  279. padding:30px 22px;
  280. .record_det{
  281. height: 38px;
  282. line-height: 38px;
  283. display: flex;
  284. justify-content:space-between;
  285. .year_l{
  286. font-size: 30px;
  287. display: flex;
  288. align-items: center;
  289. color: #858585;
  290. .unit{
  291. padding-left: 5px;
  292. }
  293. .icon{
  294. width: 23px;
  295. height: 12px;
  296. display: block;
  297. background: url('../../assets/images/sunVillage_info/list_icon_1.png') no-repeat;
  298. background-size: 100% 100%;
  299. margin-bottom: 4px;
  300. margin-right: 8px;
  301. &.zk {
  302. transform: rotate(0deg)
  303. }
  304. &.ss{
  305. transform: rotate(180deg)
  306. }
  307. }
  308. }
  309. .total_r{
  310. font-size: 26px;
  311. letter-spacing: 2px;
  312. }
  313. }
  314. .record_list{
  315. display: flex;
  316. flex-flow: wrap;
  317. align-items: center;
  318. justify-content: space-between;
  319. .flex_block{
  320. font-size: 30px;
  321. color: #aaaaaa;
  322. &.current{
  323. color: #2facfe;
  324. font-weight: bold;
  325. }
  326. }
  327. }
  328. .month_list{
  329. align-items: center;
  330. justify-content: space-between;
  331. .flex_block{
  332. font-size: 30px;
  333. color: #aaaaaa;
  334. padding-right: 0px;
  335. &.current{
  336. color: #2facfe;
  337. font-weight: bold;
  338. }
  339. }
  340. }
  341. }
  342. .list_main{
  343. padding: 0 22px;
  344. .item{
  345. height: 140px;
  346. border-radius: 30px;
  347. background: #fff;
  348. box-shadow: 4px 6px 5px rgba(63, 68, 75, 0.1);
  349. padding:25px 32px;
  350. display: flex;
  351. margin-bottom: 20px;
  352. .info{
  353. flex:0 0 450px;
  354. .title{
  355. display: flex;
  356. font-size: 32px;
  357. align-items: center;
  358. height: 58px;
  359. .icon_box{
  360. width: 34px;
  361. display: block;
  362. height: 30px;
  363. background: url('../../assets/images/sunVillage_info/list_icon_2.png') no-repeat;
  364. background-size: 100% 100%;
  365. margin-right: 10px;
  366. }
  367. .news_title{
  368. max-width:330px;
  369. overflow: hidden;
  370. white-space: nowrap;
  371. text-overflow: ellipsis;
  372. -o-text-overflow: ellipsis;
  373. }
  374. .tips_mark{
  375. width: 34px;
  376. height: 34px;
  377. background: #fa0c0c;
  378. border-radius: 8px;
  379. font-size: 24px;
  380. color: #fff;
  381. text-align: center;
  382. line-height: 34px;
  383. margin-left: 10px;
  384. }
  385. .money{
  386. font-size: 14PX;
  387. color: red;
  388. margin-left: auto;
  389. }
  390. }
  391. .time{
  392. font-size: 24px;
  393. color: #858585;
  394. display: flex;
  395. align-items: center;
  396. height: 30px;
  397. margin-top: 6px;
  398. .icon_time{
  399. width: 25px;
  400. height: 25px;
  401. background: url('../../assets/images/sunVillage_info/list_icon_4.png') no-repeat;
  402. background-size: 100% 100%;
  403. margin-right: 10px;
  404. }
  405. }
  406. }
  407. .operation{
  408. flex: 1;
  409. display: flex;
  410. align-items: center;
  411. justify-content: flex-end;
  412. text-align: right;
  413. .opera_btn{
  414. width: 52px;
  415. height: 52px;
  416. border-radius: 50%;
  417. display: flex;
  418. align-items: center;
  419. justify-content:center;
  420. &.delete{
  421. background:#df0707;
  422. margin-left: 28px;
  423. .icon{
  424. width: 22px;
  425. height: 29px;
  426. background: url('../../assets/images/sunVillage_info/list_icon_7.png') no-repeat;
  427. background-size: 100% 100%;
  428. display: block;
  429. }
  430. }
  431. &.edit{
  432. background: #79cf13;
  433. .icon {
  434. width: 26px;
  435. height: 25px;
  436. background: url('../../assets/images/sunVillage_info/list_icon_6.png') no-repeat;
  437. background-size: 100% 100%;
  438. display: block;
  439. }
  440. }
  441. &.view{
  442. background: #3494ff;
  443. margin-left: 28px;
  444. .icon {
  445. width: 29px;
  446. height: 21px;
  447. background: url('../../assets/images/sunVillage_info/list_icon_3.png') no-repeat;
  448. background-size: 100% 100%;
  449. display: block;
  450. }
  451. }
  452. &.list{
  453. background: #79cf13;
  454. .icon {
  455. width: 29px;
  456. height: 21px;
  457. background: url('../../assets/images/sunVillage_info/list_icon_10.png') no-repeat;
  458. background-size: 100% 100%;
  459. display: block;
  460. }
  461. }
  462. }
  463. }
  464. }
  465. }
  466. .bottom_tips{
  467. font-size: 24px;
  468. color: #a7a6a6;
  469. text-align: center;
  470. margin-top: 32px;
  471. background: url('../../assets/images/sunVillage_info/list_icon_8.png') center center no-repeat;
  472. background-size: 260px 2px;
  473. .xs{
  474. padding:0 8px;
  475. background: #e9e9e9;
  476. }
  477. }
  478. }
  479. </style>