dataCenter.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  1. <template>
  2. <view class="page">
  3. <nav-bar title="招聘数据中心"></nav-bar>
  4. <!-- Filter Section -->
  5. <view class="filter-section">
  6. <view class="filter-buttons">
  7. <!-- <view class="filter-btn" @click="selectDateRange">
  8. <text class="filter-text">2025.07.30-08.06</text>
  9. <u-icon name="arrow-down" color="#016BF6" size="16"></u-icon>
  10. </view> -->
  11. <!-- <view class="filter-btn" @click="selectPosition">
  12. <text class="filter-text">亚马逊运营总监</text>
  13. <u-icon name="arrow-down" color="#016BF6" size="16"></u-icon>
  14. </view> -->
  15. <picker @change="changeDate" :value="weekIndex" :range="weekList" :range-key="'name'">
  16. <view class="filter-btn">
  17. <text class="filter-text">{{ weekList.length ? weekList[weekIndex].name : '/' }}</text>
  18. <u-icon name="arrow-down" color="#016BF6" size="16"></u-icon>
  19. </view>
  20. </picker>
  21. <picker @change="changeZw" :value="zwIndex" :range="zwList" :range-key="'name'">
  22. <view class="filter-btn">
  23. <text class="filter-text">{{ zwList.length ? zwList[zwIndex].name : '/' }}</text>
  24. <u-icon name="arrow-down" color="#016BF6" size="16"></u-icon>
  25. </view>
  26. </picker>
  27. </view>
  28. </view>
  29. <!-- Content Section -->
  30. <view class="content-section">
  31. <!-- Recruitment Progress Card -->
  32. <view class="card-header">
  33. <text class="hearder-title">招聘进展</text>
  34. </view>
  35. <!-- New Card -->
  36. <view class="data-card">
  37. <view class="card-header">
  38. <view class="card-title">
  39. <view class="card-icon-wrapper">
  40. <image src="/static/images/eye.svg" class="card-icon" mode="aspectFit"></image>
  41. </view>
  42. <text>查看</text>
  43. </view>
  44. </view>
  45. <view class="card-content">
  46. <view class="data-row">
  47. <view class="data-item">
  48. <text class="data-label">我看过</text>
  49. <view class="data-value-wrapper">
  50. <text class="data-value">{{ dataStatics.iSaw }}</text>
  51. <text class="data-unit">人</text>
  52. </view>
  53. </view>
  54. <view class="data-item">
  55. <text class="data-label">看过我</text>
  56. <view class="data-value-wrapper">
  57. <text class="data-value">{{ dataStatics.sawMe }}</text>
  58. <text class="data-unit">人</text>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="data-card">
  65. <view class="card-header">
  66. <view class="card-title">
  67. <view class="card-icon-wrapper">
  68. <image src="/static/images/goutong.svg" class="card-icon" mode="aspectFit"></image>
  69. </view>
  70. <text>沟通</text>
  71. </view>
  72. </view>
  73. <view class="card-content">
  74. <view class="data-row">
  75. <view class="data-item">
  76. <text class="data-label">我沟通</text>
  77. <view class="data-value-wrapper">
  78. <text class="data-value">{{ dataStatics.iCommunicated }}</text>
  79. <text class="data-unit">人</text>
  80. </view>
  81. </view>
  82. <view class="data-item">
  83. <text class="data-label">求职者</text>
  84. <view class="data-value-wrapper">
  85. <text class="data-value">{{ dataStatics.candidateCommunicated }}</text>
  86. <text class="data-unit">人</text>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </view>
  92. <view class="data-card">
  93. <view class="card-header">
  94. <view class="card-title">
  95. <view class="card-icon-wrapper">
  96. <image src="/static/images/lianxi.svg" class="card-icon" mode="aspectFit"></image>
  97. </view>
  98. <text>获取简历联系方式</text>
  99. </view>
  100. </view>
  101. <view class="card-content">
  102. <view class="data-row">
  103. <view class="data-item">
  104. <text class="data-label">合计</text>
  105. <view class="data-value-wrapper">
  106. <text class="data-value">{{ dataStatics.receivedResumes + dataStatics.exchangedContact }}</text>
  107. <text class="data-unit">人</text>
  108. </view>
  109. </view>
  110. <view class="data-item">
  111. <text class="data-label">获取简历</text>
  112. <view class="data-value-wrapper">
  113. <text class="data-value">{{ dataStatics.receivedResumes }}</text>
  114. <text class="data-unit">人</text>
  115. </view>
  116. </view>
  117. <view class="data-item">
  118. <text class="data-label">交换电话/微信</text>
  119. <view class="data-value-wrapper">
  120. <text class="data-value">{{ dataStatics.exchangedContact }}</text>
  121. <text class="data-unit">人</text>
  122. </view>
  123. </view>
  124. <!-- <view class="data-item">
  125. <text class="data-label">交换微信</text>
  126. <view class="data-value-wrapper">
  127. <text class="data-value">2120</text>
  128. <text class="data-unit">人</text>
  129. </view>
  130. </view> -->
  131. </view>
  132. </view>
  133. </view>
  134. <view class="data-card">
  135. <view class="card-header">
  136. <view class="card-title">
  137. <view class="card-icon-wrapper">
  138. <image src="/static/images/huoqu.svg" class="card-icon" mode="aspectFit"></image>
  139. </view>
  140. <text>获取简历联系方式</text>
  141. </view>
  142. </view>
  143. <view class="card-content">
  144. <view class="data-row">
  145. <view class="data-item">
  146. <text class="data-label">邀约面试</text>
  147. <view class="data-value-wrapper">
  148. <text class="data-value">{{ dataStatics.acceptedInterview }}</text>
  149. <text class="data-unit">人</text>
  150. </view>
  151. </view>
  152. <view class="data-item">
  153. <text class="data-label">接受面试</text>
  154. <view class="data-value-wrapper">
  155. <text class="data-value">{{ dataStatics.acceptedInterview }}</text>
  156. <text class="data-unit">人</text>
  157. </view>
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. </view>
  163. </view>
  164. </template>
  165. <script>
  166. import navBar from "@/components/nav-bar/index.vue";
  167. import { getPrevious8Weeks } from './dateFormate'
  168. export default {
  169. components: {
  170. navBar
  171. },
  172. data() {
  173. return {
  174. zwList: [
  175. {
  176. name: '全部',
  177. id: ''
  178. }
  179. ],
  180. zwIndex: 0,
  181. weekList: [],
  182. weekIndex: 0,
  183. dataStatics: {}
  184. }
  185. },
  186. onLoad() {
  187. this.getZwList()
  188. this.weekList = []
  189. getPrevious8Weeks(new Date()).forEach(it => {
  190. // this.weekList.push([
  191. // it[0],it[1],it.join('~')
  192. // ]),
  193. this.weekList.push({
  194. start: it[0],
  195. end: it[1],
  196. name: it.join('~')
  197. })
  198. })
  199. },
  200. methods: {
  201. changeDate(e) {
  202. this.weekIndex = e.detail.value;
  203. this.getDataStatics()
  204. },
  205. getZwList() {
  206. this.$Request.getT("/app/postPush/getMyPostPush").then(res => {
  207. res.data.records.forEach(item => {
  208. this.zwList.push({
  209. name: item.ruleClassifyName,
  210. id: item.postPushId
  211. })
  212. })
  213. this.getDataStatics()
  214. })
  215. },
  216. changeZw(e) {
  217. this.zwIndex = e.detail.value;
  218. this.getDataStatics()
  219. },
  220. getDataStatics() {
  221. let [startDate, endDate] = this.weekList[this.weekIndex].name.split('~');
  222. let data = {
  223. postPushId: this.zwList[this.zwIndex].id,
  224. // todayStart:this.formatDateRange(new Date(),new Date())[0],
  225. // todayEnd:this.formatDateRange(new Date(),new Date())[1],
  226. todayStart: `${startDate} 00:00:00`,
  227. todayEnd: `${endDate} 23:59:59`,
  228. }
  229. this.$Request.getT("/app/user/userYesterdayData", data).then(res => {
  230. this.dataStatics = res.data;
  231. })
  232. },
  233. formatDateRange(startDate, endDate) {
  234. // 格式化日期为 YYYY-MM-DD 格式
  235. const formatDate = (date) => {
  236. const year = date.getFullYear();
  237. const month = String(date.getMonth() + 1).padStart(2, '0');
  238. const day = String(date.getDate()).padStart(2, '0');
  239. return `${year}-${month}-${day}`;
  240. };
  241. // 创建开始日期的 00:00:00
  242. const startDateTime = `${formatDate(startDate)} 00:00:00`;
  243. // 创建结束日期的 23:59:59
  244. const endDateTime = `${formatDate(endDate)} 23:59:59`;
  245. return [startDateTime, endDateTime];
  246. },
  247. goBack() {
  248. uni.navigateBack()
  249. },
  250. goToCommunicationRecords() {
  251. uni.navigateTo({
  252. url: '/pages/recruitmentData/communicationRecords'
  253. })
  254. },
  255. selectDateRange() {
  256. console.log('选择日期范围')
  257. },
  258. selectPosition() {
  259. console.log('选择职位')
  260. }
  261. }
  262. }
  263. </script>
  264. <style lang="scss" scoped>
  265. .page {
  266. background: linear-gradient(180.00deg, rgba(255, 102, 0, 1), rgba(255, 102, 0, 0) 100%);
  267. background-size: 100% 35%;
  268. background-position: center top;
  269. background-repeat: no-repeat;
  270. min-height: 100vh;
  271. }
  272. /* Filter Section */
  273. .filter-section {
  274. padding: 0rpx 32rpx 32rpx 32rpx;
  275. }
  276. .filter-buttons {
  277. display: flex;
  278. gap: 20rpx;
  279. }
  280. .filter-btn {
  281. flex: 1;
  282. padding: 16rpx 20rpx;
  283. background: rgba(255, 255, 255, 1);
  284. border-radius: 12rpx;
  285. display: flex;
  286. align-items: center;
  287. justify-content: center;
  288. gap: 12rpx;
  289. }
  290. .filter-text {
  291. color: rgba(1, 107, 246, 1);
  292. font-family: DM Sans;
  293. font-size: 24rpx;
  294. font-weight: 400;
  295. line-height: 32rpx;
  296. letter-spacing: -0.5px;
  297. text-align: center;
  298. }
  299. /* Content Section */
  300. .content-section {
  301. margin: 0 32rpx 32rpx 32rpx;
  302. box-sizing: border-box;
  303. background: rgba(255, 255, 255, 1);
  304. border-radius: 12rpx;
  305. border: 0.5px solid rgba(227, 231, 236, 1);
  306. padding: 32rpx 20rpx;
  307. }
  308. .data-card {
  309. background: rgba(255, 255, 255, 1);
  310. border-radius: 12rpx;
  311. padding: 24rpx;
  312. border: 0.5px solid rgba(227, 231, 236, 1);
  313. margin-top: 24rpx;
  314. }
  315. .hearder-title {
  316. color: rgba(23, 23, 37, 1);
  317. font-family: DM Sans;
  318. font-size: 28rpx;
  319. font-weight: 400;
  320. line-height: 44rpx;
  321. letter-spacing: 0.5%;
  322. text-align: left;
  323. }
  324. .card-title {
  325. display: flex;
  326. align-items: center;
  327. gap: 12rpx;
  328. }
  329. .card-icon-wrapper {
  330. width: 32rpx;
  331. height: 32rpx;
  332. display: flex;
  333. align-items: center;
  334. justify-content: center;
  335. }
  336. .card-icon {
  337. width: 32rpx;
  338. height: 32rpx;
  339. }
  340. .card-title text {
  341. color: rgba(102, 102, 102, 1);
  342. font-family: DM Sans;
  343. font-size: 24rpx;
  344. font-weight: 400;
  345. line-height: 32rpx;
  346. letter-spacing: 0%;
  347. text-align: left;
  348. }
  349. .card-content {
  350. margin-top: 12rpx;
  351. }
  352. .data-row {
  353. display: flex;
  354. gap: 24rpx;
  355. }
  356. .data-item {
  357. // flex: 1;
  358. // display: flex;
  359. // flex-direction: column;
  360. // align-items: flex-start;
  361. }
  362. .data-label {
  363. color: rgba(102, 102, 102, 1);
  364. font-family: DM Sans;
  365. font-size: 24rpx;
  366. font-weight: 400;
  367. line-height: 32rpx;
  368. letter-spacing: 0%;
  369. text-align: left;
  370. margin-bottom: 12rpx;
  371. }
  372. .data-value-wrapper {
  373. display: flex;
  374. align-items: baseline;
  375. gap: 4rpx;
  376. }
  377. .data-value {
  378. color: rgba(51, 51, 51, 1);
  379. font-family: DM Sans;
  380. font-size: 40rpx;
  381. font-weight: 400;
  382. line-height: 52rpx;
  383. letter-spacing: 0%;
  384. text-align: left;
  385. }
  386. .data-unit {
  387. color: rgba(153, 153, 153, 1);
  388. font-family: DM Sans;
  389. font-size: 24rpx;
  390. font-weight: 400;
  391. line-height: 32rpx;
  392. }
  393. </style>