index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. <template>
  2. <div class="introduce-letter-page">
  3. <NavBar />
  4. <div class="header">
  5. <van-search
  6. v-model="query.keyWords"
  7. class="van-hairline--bottom"
  8. placeholder="请输入人员姓名关键字"
  9. @clear="refreshData" @change="refreshData"
  10. />
  11. <div class="seg-tabs">
  12. <van-tabs v-model="query.status" type="card" color="rgb(0, 140, 214)" style="border-color: rgb(0, 140, 214);" shrink animated @change="refreshData">
  13. <van-tab title="全部" :name="-1" />
  14. <van-tab title="使用中" :name="1" />
  15. <van-tab title="已失效" :name="2" />
  16. </van-tabs>
  17. </div>
  18. <div class="status-filter">
  19. <van-tabs v-model="query.outInRequestStatus" color="rgb(0, 140, 214)" line-width="0" @change="refreshData">
  20. <van-tab title="全部" :name="-1" />
  21. <!-- <van-tab title="待办" :name="0" />
  22. <van-tab title="逾期" :name="2" />
  23. <van-tab title="补登" :name="3" />
  24. <van-tab title="已完成" :name="4" />
  25. <van-tab title="已拒绝" :name="5" /> -->
  26. <van-tab title="待审批" :name="0" />
  27. <van-tab title="待登记" :name="1" />
  28. <van-tab title="已完成" :name="2" />
  29. <van-tab title="已拒绝" :name="3" />
  30. <van-tab title="已逾期" :name="4" />
  31. <van-tab title="已补登" :name="5" />
  32. </van-tabs>
  33. </div>
  34. </div>
  35. <div class="card-list">
  36. <Scroll
  37. ref="Scroll"
  38. @refresh="refreshData"
  39. @loadMore="getDataList"
  40. :pullup="pullup"
  41. >
  42. <div class="list-section">
  43. <div v-for="item in dataList" :key="item.id">
  44. <div class="letter-card" @click="goLetterDetail(item.id)">
  45. <div class="card-header">
  46. <div class="title">{{ item.letterNo ==null || item.letterNo==''?"紧急出入": item.letterNo }}</div>
  47. <van-tag size="large" v-if="item.status === 1" type="success" round>使用中</van-tag>
  48. <van-tag size="large" v-else-if="item.status === 2" type="danger" round>已失效</van-tag>
  49. </div>
  50. <van-divider />
  51. <div class="period">
  52. <span>有效期:</span>
  53. <span>{{ item.startTime }} 至 {{ item.endTime }}</span>
  54. </div>
  55. <div class="certs" @click.stop>
  56. <div class="cert-thumb" v-for="user in item.userInfos" :key="user.id">
  57. <div class="cert" >
  58. <div class="cert-img">
  59. <ImageThumbnail
  60. :image-list="user.imgFile"
  61. height="60px"
  62. width="80px"
  63. radius="8px"
  64. />
  65. </div>
  66. <div class="cert-img-name"><span>{{user.userName}}</span></div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="records" v-if="item.recentOutInRequestRecords.length > 0">
  71. <div style="display: flex;align-items: center;">
  72. <!-- <van-icon name="underway-o" class="rec-icon"/> -->
  73. <img src="../../../../assets/svg/history.svg" width="15px" height="15px" class="rec-icon"/>
  74. <span class="rec-text">最新申请记录</span>
  75. </div>
  76. <!-- <van-icon name="more" /> -->
  77. <div>
  78. <!-- <van-icon size="25px" name="ellipsis" /> -->
  79. <span class="rec-title" @click.stop="goOutInList()" >更多</span>
  80. </div>
  81. </div>
  82. <div class="entries">
  83. <div class="entry" v-for="(e, idx) in item.recentOutInRequestRecords" :key="idx" @click.stop="handleOutInRequestRecordClick(e)">
  84. <div class="entry-left">
  85. <div class="entry-title">出入名单:{{ e.userNames }}</div>
  86. <div class="entry-sub">核对人:{{ e.createBy }}</div>
  87. <div class="entry-time" >
  88. <span>申请时间:{{ dayjs(e.createTime).format("YYYY-MM-DD HH:mm") }}</span>
  89. <span v-if="e.approveTime"> | 审核时间:{{ dayjs(e.approveTime).format("YYYY-MM-DD HH:mm") }}</span>
  90. </div>
  91. <!-- <div class="entry-time" v-if="e.approveTime">审核时间:{{ dayjs(e.approveTime).format("YYYY-MM-DD HH:mm") }}</div> -->
  92. </div>
  93. <div class="entry-right">
  94. <van-tag size="large" v-if="e.status===0" type="warning" plain>待审批</van-tag>
  95. <van-tag size="large" v-else-if="e.status===1" type="primary" plain>待登记</van-tag>
  96. <van-tag size="large" v-else-if="e.status===2" type="success" plain>已完成</van-tag>
  97. <van-tag size="large" v-else-if="e.status===3" type="danger" plain>已拒绝</van-tag>
  98. <van-tag size="large" v-else-if="e.status===4" type="danger" plain>已逾期</van-tag>
  99. <van-tag size="large" v-else-if="e.status===5" type="success" plain>已补登</van-tag>
  100. </div>
  101. </div>
  102. </div>
  103. <div class="card-footer" v-if="item.status === 1">
  104. <van-button v-hasPermi="['core:outinrequest:add']" block round size="small" type="info" @click.stop="addOutInRequest(item)">提交出入申请</van-button>
  105. </div>
  106. </div>
  107. </div>
  108. <van-empty v-if="dataList.length === 0" description="暂无数据" />
  109. </div>
  110. </Scroll>
  111. </div>
  112. <!-- <drag-button></drag-button> -->
  113. <drag-button @btnClick="clickAdd" v-hasPermi="['core:letter:add']"></drag-button>
  114. </div>
  115. </template>
  116. <script>
  117. import NavBar from '@/components/NavBar'
  118. import dayjs from "dayjs";
  119. import Scroll from '@/components/scroll/scroll'
  120. import Card from '@/components/card'
  121. import dateCell from '@/components/dateCell'
  122. import selectCell from '@/components/selectCell'
  123. import DragButton from '@/components/DragButton'
  124. import { ImagePreview } from 'vant'
  125. import {mapGetters} from "vuex";
  126. import {imgUrl} from "@/utils";
  127. import ImageThumbnail from './imageThumbnail.vue';
  128. import {dataList} from './api'
  129. export default {
  130. name: 'IntroduceLetterPage',
  131. components: {
  132. NavBar,
  133. Scroll,
  134. Card,
  135. dateCell,
  136. selectCell,
  137. DragButton,
  138. ImageThumbnail
  139. },
  140. data() {
  141. return {
  142. pullup:false,
  143. total: 0,
  144. query: {
  145. pageSize:10,
  146. pageNum:1,
  147. status: -1,
  148. outInRequestStatus: -1,
  149. keyWords: ''
  150. },
  151. dataList:[]
  152. }
  153. },
  154. beforeRouteEnter(to,from,next){
  155. next(vm=>{
  156. if(to.params.event === 'refresh'){
  157. vm.refreshData();
  158. }
  159. })
  160. },
  161. mounted() {
  162. this.initData();
  163. },
  164. computed: {
  165. ...mapGetters(['orgId','id','dictionary']),
  166. },
  167. methods: {
  168. // handleTopTabChange() {},
  169. // handleStatusChange() {},
  170. addOutInRequest(item) {
  171. // this.$toast(`提交:${item.id}`)
  172. this.$router.push({
  173. path:'/new/letter/AddOutInRequset',
  174. query: {letterId:item.id}
  175. });
  176. },
  177. onCreate() {
  178. this.$toast('新建介绍信')
  179. },
  180. // preView(val) {
  181. // if(Array.isArray(val)){
  182. // let arr = val.map(v=>{
  183. // return imgUrl(v);
  184. // })
  185. // ImagePreview(arr);
  186. // }else {
  187. // ImagePreview(["http://47.92.229.224:8081/statics/2025/09/01/564978e86d5042fe8e3d9e266a10ca04/20250901141424A018.png"]);
  188. // }
  189. // },
  190. goOutInList()
  191. {
  192. // console.log()
  193. this.$router.push({
  194. path:'/new/outIn',
  195. });
  196. },
  197. goLetterDetail(id){
  198. // if(isAddOutInRequest)
  199. // {
  200. // console.log(id,'isAddOutInRequest')
  201. // this.$router.push({
  202. // path:'/visitAddOutInRequset',
  203. // query: {id}
  204. // });
  205. // }
  206. // else{
  207. console.log(id,'letterId')
  208. this.$router.push({
  209. path:'/new/letter/detail',
  210. query: {letterId:id}
  211. });
  212. // }
  213. },
  214. handleOutInRequestRecordClick(outInRequest)
  215. {
  216. console.log('outInRequest',outInRequest);
  217. // 待审批
  218. if(outInRequest.status === 0)
  219. {
  220. this.$router.push({
  221. path:'/new/letter/approvalOutInRequest',
  222. query: {outInRequestId:outInRequest.id}
  223. });
  224. }
  225. //待登记 / 已过期
  226. else if(outInRequest.status === 1 || outInRequest.status === 4)
  227. {
  228. this.$router.push({
  229. path:'/new/outIn/fillOutInInfo',
  230. query: {outInRequestId:outInRequest.id}
  231. });
  232. }
  233. //已完成 / 已补登
  234. else if(outInRequest.status === 2 || outInRequest.status === 5)
  235. {
  236. this.$router.push({
  237. path:'/new/outIn/outInRequest/completeDetail',
  238. query: {outInRequestId:outInRequest.id}
  239. });
  240. }
  241. //已拒绝
  242. else if(outInRequest.status === 3)
  243. {
  244. this.$router.push({
  245. path:'/new/letter/outInRequest/refuseDetail',
  246. query: {outInRequestId:outInRequest.id}
  247. });
  248. }
  249. },
  250. refreshData(){
  251. this.pullup = true;
  252. this.query.pageNum = 1;
  253. this.total = 0;
  254. this.dataList = [];
  255. this.getDataList();
  256. },
  257. //初始化数据
  258. initData(){
  259. this.getDataList();
  260. },
  261. //获取数据列表
  262. getDataList(){
  263. if( this.dataList.length !== 0 && this.dataList.length >= this.total) {
  264. this.pullup = false;
  265. this.$toast('已加载完毕');
  266. return;
  267. }
  268. let data = {
  269. ...this.query,
  270. orgId:this.orgId
  271. }
  272. if(data.status === -1){
  273. delete data.status;
  274. }
  275. if(data.outInRequestStatus === -1){
  276. delete data.outInRequestStatus;
  277. }
  278. dataList(data).then(res=>{
  279. if(res.total === '0'){
  280. this.pullup = false;
  281. this.$toast('已加载完毕');
  282. return
  283. }
  284. this.total = res.total;
  285. if(this.dataList.length < res.total) {
  286. this.dataList = [...this.dataList,...res.rows] ;
  287. this.pullup = true;
  288. this.query.pageNum++;
  289. this.$refs.Scroll.refresh();
  290. }
  291. })
  292. },
  293. clickAdd(){
  294. this.$router.push({
  295. path:'/new/addletter',
  296. query:{type:'add'}
  297. });
  298. },
  299. }
  300. }
  301. </script>
  302. <style lang="scss">
  303. .introduce-letter-page{
  304. .van-search{
  305. margin: 0px !important;
  306. }
  307. .van-divider{
  308. margin: 1.266667vw 0 !important;
  309. }
  310. .van-tabs__nav--card {
  311. border-radius: 25px !important;
  312. margin: 0 0 !important;
  313. }
  314. .van-tabs--card .van-tab:first-child {
  315. border-bottom-left-radius: 20px !important;
  316. border-top-left-radius: 20px !important;
  317. }
  318. .van-tabs--card .van-tab:last-child {
  319. border-bottom-right-radius: 20px !important;
  320. border-top-right-radius: 20px !important;
  321. }
  322. .van-tabs--line{
  323. .van-tab {
  324. border-radius: 25px !important;
  325. background: white !important;
  326. border: 1px solid #008cd6 !important;
  327. // margin-right: 10px;
  328. color:#999;
  329. }
  330. .van-tab--active
  331. {
  332. background: #008cd6 !important;
  333. color:white;
  334. }
  335. }
  336. .van-tabs__wrap--scrollable .van-tab
  337. {
  338. padding: 0 0 !important;
  339. }
  340. .van-tabs--line .van-tabs__wrap{
  341. padding-right: 0 !important;
  342. height: 8vw;
  343. }
  344. .van-tag {
  345. font-size:26px;
  346. }
  347. .van-tabs__nav--line.van-tabs__nav--complete
  348. {
  349. padding-right: 0 !important;
  350. padding-left: 0 !important;
  351. }
  352. }
  353. </style>
  354. <style scoped>
  355. .introduce-letter-page {
  356. min-height: 100vh;
  357. background: #f5f7fb;
  358. padding-bottom: 80px;
  359. }
  360. .header {
  361. position: sticky;
  362. top: 0;
  363. z-index: 10;
  364. background: white;
  365. margin: 16px 21px 0 21px;
  366. }
  367. .seg-tabs {
  368. margin-bottom: 16px;
  369. }
  370. .status-filter {
  371. padding-bottom: 16px;
  372. }
  373. .card-list{
  374. padding:0 5px 0px 5px;
  375. height: calc(100vh - 370px);
  376. overflow: auto;
  377. }
  378. .list-section {
  379. padding: 16px;
  380. }
  381. .letter-card {
  382. background: #fff;
  383. border-radius: 16px;
  384. padding: 16px;
  385. margin-bottom: 16px;
  386. box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  387. }
  388. .card-header {
  389. display: flex;
  390. align-items: center;
  391. justify-content: space-between;
  392. font-weight: 550;
  393. font-size: 30px;
  394. margin-bottom: 8px;
  395. margin-left: 15px;
  396. }
  397. .period {
  398. font-size: 24px;
  399. color: #969799;
  400. margin-bottom: 5px;
  401. }
  402. .certs {
  403. display: flex;
  404. flex-wrap:wrap;
  405. margin: 10px 0;
  406. }
  407. .cert-thumb {
  408. border-radius: 16px;
  409. margin-right: 10px;
  410. display: flex;
  411. flex-direction: column;
  412. align-items: center;
  413. justify-content: center;
  414. }
  415. .cert {
  416. display: flex;
  417. flex-direction: column;
  418. align-items: center;
  419. justify-content: center;
  420. }
  421. .cert-img{
  422. /* width: 150px; */
  423. /* height: 115px; */
  424. /* background: #e6ebf5; */
  425. /* border-radius: 10px; */
  426. }
  427. .cert-img-name{
  428. font-size:20px;
  429. height: 25px;
  430. /* width: 150px;
  431. height: 120px; */
  432. /* background: #e6ebf5; */
  433. /* border-radius: 10px; */
  434. }
  435. .cert-label {
  436. margin-top: 6px;
  437. font-size: 16px;
  438. color: #888;
  439. }
  440. .records {
  441. display: flex;
  442. align-items: center;
  443. color: #888;
  444. font-size: 24px;
  445. padding-bottom: 10px;
  446. border-bottom: 1px solid #f2f3f5;
  447. justify-content:space-between;
  448. }
  449. .rec-icon { margin-right: 4px; }
  450. .rec-text { font-size: 24px; }
  451. .rec-title { font-size: 24px; color: #333; }
  452. .entries { margin-top: 0px;margin-left: 15px; }
  453. .entry {
  454. display: flex;
  455. align-items: center;
  456. justify-content: space-between;
  457. padding: 10px 0;
  458. border-bottom: 1px solid #f2f3f5;
  459. }
  460. .entry-right{
  461. margin-bottom: 50px;
  462. }
  463. .entry:last-child { border-bottom: none; }
  464. .entry-title { font-size: 28px; color: #333; }
  465. .entry-sub { font-size: 24px; color: #999; margin-top: 8px; }
  466. .entry-time { font-size: 20px; color: #999; margin-top: 8px; }
  467. .card-footer {
  468. margin-top: 8px;
  469. }
  470. .fab {
  471. position: fixed;
  472. right: 16px;
  473. bottom: 24px;
  474. width: 52px;
  475. height: 52px;
  476. border-radius: 50%;
  477. background: #2f6bff;
  478. color: #fff;
  479. display: flex;
  480. align-items: center;
  481. justify-content: center;
  482. box-shadow: 0 8px 20px rgba(47,107,255,0.35);
  483. }
  484. /* 深度选择器覆盖 Vant 组件圆角 */
  485. ::v-deep .van-search {
  486. border-radius: 16px;
  487. overflow: hidden;
  488. margin: 8px 16px 0;
  489. }
  490. ::v-deep .van-search__content {
  491. border-radius: 24px;
  492. }
  493. ::v-deep .van-tab--card {
  494. border-radius: 16px !important;
  495. }
  496. ::v-deep .van-tabs--card .van-tabs__wrap {
  497. border-radius: 16px;
  498. overflow: hidden;
  499. }
  500. ::v-deep .van-button--round {
  501. border-radius: 24px;
  502. }
  503. </style>