dataCenter.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. zwIndex: 0,
  176. weekList: [],
  177. weekIndex: 0,
  178. dataStatics: {}
  179. }
  180. },
  181. onLoad() {
  182. this.getZwList()
  183. this.weekList = []
  184. getPrevious8Weeks(new Date()).forEach(it => {
  185. // this.weekList.push([
  186. // it[0],it[1],it.join('~')
  187. // ]),
  188. this.weekList.push({
  189. start: it[0],
  190. end: it[1],
  191. name: it.join('~')
  192. })
  193. })
  194. },
  195. methods: {
  196. changeDate(e) {
  197. this.weekIndex = e.detail.value;
  198. this.getDataStatics()
  199. },
  200. getZwList() {
  201. this.$Request.getT("/app/postPush/getMyPostPush").then(res => {
  202. res.data.records.forEach(item => {
  203. this.zwList.push({
  204. name: item.ruleClassifyName,
  205. id: item.postPushId
  206. })
  207. })
  208. this.getDataStatics()
  209. })
  210. },
  211. changeZw(e) {
  212. this.zwIndex = e.detail.value;
  213. this.getDataStatics()
  214. },
  215. getDataStatics() {
  216. console.log(this.weekList[this.weekIndex].name, '服了')
  217. let [startDate, endDate] = this.weekList[this.weekIndex].name.split('~');
  218. let data = {
  219. postPushId: this.zwList[this.zwIndex].id,
  220. // todayStart:this.formatDateRange(new Date(),new Date())[0],
  221. // todayEnd:this.formatDateRange(new Date(),new Date())[1],
  222. todayStart: `${startDate} 00:00:00`,
  223. todayEnd: `${endDate} 23:59:59`,
  224. }
  225. this.$Request.getT("/app/user/userYesterdayData", data).then(res => {
  226. this.dataStatics = res.data;
  227. })
  228. },
  229. formatDateRange(startDate, endDate) {
  230. // 格式化日期为 YYYY-MM-DD 格式
  231. const formatDate = (date) => {
  232. const year = date.getFullYear();
  233. const month = String(date.getMonth() + 1).padStart(2, '0');
  234. const day = String(date.getDate()).padStart(2, '0');
  235. return `${year}-${month}-${day}`;
  236. };
  237. // 创建开始日期的 00:00:00
  238. const startDateTime = `${formatDate(startDate)} 00:00:00`;
  239. // 创建结束日期的 23:59:59
  240. const endDateTime = `${formatDate(endDate)} 23:59:59`;
  241. return [startDateTime, endDateTime];
  242. },
  243. goBack() {
  244. uni.navigateBack()
  245. },
  246. goToCommunicationRecords() {
  247. uni.navigateTo({
  248. url: '/pages/recruitmentData/communicationRecords'
  249. })
  250. },
  251. selectDateRange() {
  252. console.log('选择日期范围')
  253. },
  254. selectPosition() {
  255. console.log('选择职位')
  256. }
  257. }
  258. }
  259. </script>
  260. <style lang="scss" scoped>
  261. .page {
  262. background: linear-gradient(180.00deg, rgba(255, 102, 0, 1), rgba(255, 102, 0, 0) 100%);
  263. background-size: 100% 35%;
  264. background-position: center top;
  265. background-repeat: no-repeat;
  266. min-height: 100vh;
  267. }
  268. /* Filter Section */
  269. .filter-section {
  270. padding: 0rpx 32rpx 32rpx 32rpx;
  271. }
  272. .filter-buttons {
  273. display: flex;
  274. gap: 20rpx;
  275. }
  276. .filter-btn {
  277. flex: 1;
  278. padding: 16rpx 20rpx;
  279. background: rgba(255, 255, 255, 1);
  280. border-radius: 12rpx;
  281. display: flex;
  282. align-items: center;
  283. justify-content: center;
  284. gap: 12rpx;
  285. }
  286. .filter-text {
  287. color: rgba(1, 107, 246, 1);
  288. font-family: DM Sans;
  289. font-size: 24rpx;
  290. font-weight: 400;
  291. line-height: 32rpx;
  292. letter-spacing: -0.5px;
  293. text-align: center;
  294. }
  295. /* Content Section */
  296. .content-section {
  297. margin: 0 32rpx 32rpx 32rpx;
  298. box-sizing: border-box;
  299. background: rgba(255, 255, 255, 1);
  300. border-radius: 12rpx;
  301. border: 0.5px solid rgba(227, 231, 236, 1);
  302. padding: 32rpx 20rpx;
  303. }
  304. .data-card {
  305. background: rgba(255, 255, 255, 1);
  306. border-radius: 12rpx;
  307. padding: 24rpx;
  308. border: 0.5px solid rgba(227, 231, 236, 1);
  309. margin-top: 24rpx;
  310. }
  311. .hearder-title {
  312. color: rgba(23, 23, 37, 1);
  313. font-family: DM Sans;
  314. font-size: 28rpx;
  315. font-weight: 400;
  316. line-height: 44rpx;
  317. letter-spacing: 0.5%;
  318. text-align: left;
  319. }
  320. .card-title {
  321. display: flex;
  322. align-items: center;
  323. gap: 12rpx;
  324. }
  325. .card-icon-wrapper {
  326. width: 32rpx;
  327. height: 32rpx;
  328. display: flex;
  329. align-items: center;
  330. justify-content: center;
  331. }
  332. .card-icon {
  333. width: 32rpx;
  334. height: 32rpx;
  335. }
  336. .card-title text {
  337. color: rgba(102, 102, 102, 1);
  338. font-family: DM Sans;
  339. font-size: 24rpx;
  340. font-weight: 400;
  341. line-height: 32rpx;
  342. letter-spacing: 0%;
  343. text-align: left;
  344. }
  345. .card-content {
  346. margin-top: 12rpx;
  347. }
  348. .data-row {
  349. display: flex;
  350. gap: 24rpx;
  351. }
  352. .data-item {
  353. // flex: 1;
  354. // display: flex;
  355. // flex-direction: column;
  356. // align-items: flex-start;
  357. }
  358. .data-label {
  359. color: rgba(102, 102, 102, 1);
  360. font-family: DM Sans;
  361. font-size: 24rpx;
  362. font-weight: 400;
  363. line-height: 32rpx;
  364. letter-spacing: 0%;
  365. text-align: left;
  366. margin-bottom: 12rpx;
  367. }
  368. .data-value-wrapper {
  369. display: flex;
  370. align-items: baseline;
  371. gap: 4rpx;
  372. }
  373. .data-value {
  374. color: rgba(51, 51, 51, 1);
  375. font-family: DM Sans;
  376. font-size: 40rpx;
  377. font-weight: 400;
  378. line-height: 52rpx;
  379. letter-spacing: 0%;
  380. text-align: left;
  381. }
  382. .data-unit {
  383. color: rgba(153, 153, 153, 1);
  384. font-family: DM Sans;
  385. font-size: 24rpx;
  386. font-weight: 400;
  387. line-height: 32rpx;
  388. }
  389. </style>