dataCenter.vue 11 KB

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